<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.besa.de/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.besa.de/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Abinash</id>
		<title>BESA® Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.besa.de/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Abinash"/>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Special:Contributions/Abinash"/>
		<updated>2026-05-10T10:42:54Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.10</generator>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing</id>
		<title>BESA Research Batch Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing"/>
				<updated>2021-11-02T12:44:40Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==  Batch Processing and Combining Conditions == --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions and Batch Module: Introduction ==&lt;br /&gt;
&lt;br /&gt;
Functions of this module are started by selecting the menu operations &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Combine Conditions...'''&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Batch Scripts...'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''Combine Condition Scripts''' provides various operations on BESA averages.&lt;br /&gt;
* '''Batch Scripts''' provides batch operations on all data files.&lt;br /&gt;
* Note that a batch script can also be performed on the current file by selecting &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Run Batch...'''&amp;lt;/span&amp;gt;&amp;quot; or by typing the shortcut key &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''R'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== File List Tab ==&lt;br /&gt;
&lt;br /&gt;
Define a list of files on which the operations will be performed. The tab is the same for Combine Conditions Scripts and for Batch Scripts. Combine Conditions Scripts only allows you to open BESA average files (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, but also &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.raw'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.swf'''&amp;lt;/span&amp;gt;, and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt; if the files have a defined pre-stimulus interval), whereas Batch Scripts allows you to open any data file whose format is known to BESA Research.&lt;br /&gt;
&lt;br /&gt;
When the Combine-Conditions or the Batch module is started, all currently opened (Combine-Conditions: averages only) files are displayed in the list.&lt;br /&gt;
&lt;br /&gt;
To the right of each file name, the number of electrodes, total number of channels, and the sampling rate used in the file are displayed. In the Combine-Conditions module, the number of Epochs (segments) and the number of differently-named conditions are also shown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add files to the list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File '''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
* Drag one or more files from Windows Explorer onto the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Remove files from the list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and confirm the delete operation in the resulting dialog.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key to mark multiple files). Right click to obtain the context menu and select &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;quot;, or just press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Reorder files within the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctr'''&amp;lt;/span&amp;gt;l key to mark multiple files). Right click to obtain the context menu and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;, or hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key '''and '''press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrows'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sort the current file list alphabetically'''&lt;br /&gt;
&lt;br /&gt;
* Click on the File bar above the list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List'''&amp;lt;/span&amp;gt; button, or the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button to load the most recently used file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Which conditions are read from a source file? (Combine-Conditions module only)'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File list from Combine Conditions:'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (1).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Don't try to open here... (Batch only)'''&lt;br /&gt;
&lt;br /&gt;
By default, this checkbox is unchecked.&lt;br /&gt;
&lt;br /&gt;
In the checked state, BESA Research doesn't check if it can open the file. Use this function '''only''' if the file is ASCII and you want to use the '''ImportASCII '''batch command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File List from Batch Scripts''':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (2).png]]&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Batch Processing &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== Batch Processing Scripts ===&lt;br /&gt;
&lt;br /&gt;
With Batch Scripts, you can define a set of operations (e.g. Artifact Scan, Average, etc.) and apply these to several data files.&lt;br /&gt;
&lt;br /&gt;
These operations include&lt;br /&gt;
&lt;br /&gt;
* Load Paradigm&lt;br /&gt;
* Artifact Scan&lt;br /&gt;
* Average&lt;br /&gt;
* Export (and Merge)&lt;br /&gt;
* File Open (switch to another data file)&lt;br /&gt;
* Set filters&lt;br /&gt;
* Specify a montage (used, for example, for export to current montage)&lt;br /&gt;
* Run automatic eye and EKG artifact correction&lt;br /&gt;
* Define artifact topographies&lt;br /&gt;
* Turn artifact correction and view on and off&lt;br /&gt;
* Read and write events&lt;br /&gt;
* Edit default block epoch (for export around triggers)&lt;br /&gt;
* Edit triggers (for export around triggers)&lt;br /&gt;
* Mark a block for export, or send the block to Source Analysis or Top View&lt;br /&gt;
* Convert patterns to triggers&lt;br /&gt;
* Attach auxiliary files (e.g. elp, sfp) to the data file&lt;br /&gt;
* Send to MATLAB&lt;br /&gt;
* Specify display configurations for the BESA Research Main, SA, and Top View windows&lt;br /&gt;
* and more - see the full list of [[#Batch Commands|Batch Commands]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An additional set of commands are available for operations in the '''Source Analysis Module''', allowing to load, create and fit dipole models, and save the results.&lt;br /&gt;
&lt;br /&gt;
A further set of commands apply to '''Time-Frequency Analysis''', allowing to start TFC, change the display, save results, and run the beamformer or DICS analyses on a selected time-frequency range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
These operations will be extended in future program releases.&lt;br /&gt;
&lt;br /&gt;
The module includes two tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* '''File List''': Define a list of files on which the operations will be performed.&lt;br /&gt;
* '''Batch''': Define or load '''batch commands'''. Run the batch.&lt;br /&gt;
&lt;br /&gt;
=== Batch Tab ===&lt;br /&gt;
&lt;br /&gt;
Load or define batch commands, and then apply them to the files in the File List.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add Command'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; to add a new command to the batch. The following dialog is opened, showing the available commands:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Select the desired command and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; or double-click on the command. A dialog box is opened, allowing to specify individual command parameters.&lt;br /&gt;
* If you click on &amp;quot;Apply at beginning of batch&amp;quot; or &amp;quot;Apply at end of batch&amp;quot;, the command will only be run at the beginning or the end of a batch. You can use this, for example, at the end of a batch to start a MATLAB script to perform statistics on the results of the batch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load and Save Batch'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load a previously defined batch or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to save the current batch to a file (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.bbat&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load the most recently used batch file. Whenever a batch is run, the current set of commands is written to the file &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Previous.bbat in'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Scripts/Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; subdirectory. This file is loaded when you press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Clear All'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Clears all commands from the window.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''View Log File'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Each time a batch is run, BESA Research adds information about the batch to a log file, with headings showing the date and time the batch was started. The file is opened automatically in Internet Explorer if errors occurred during processing. Otherwise you may open the file by &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button here or in the dialog that is displayed at the end of batch processing. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The log file is saved in xml format, and a JavaScript is used to format the display in web browsers. JavaScript should be enabled in the browser to obtain an optimal display of the results. If JavaScript is enabled, the log file is displayed as a list of headings for each batch. Click on a heading to display the results of the corresponding batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;To open the log file in the Notepad, hold the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Shift '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;key down when pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Batch Command List'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Double-click on a command to edit it. See &amp;lt;/span&amp;gt;[[#Batch Commands|Batch Commands]]&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for descriptions of the dialogs that are opened to edit each command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Right click on a command to open a context menu allowing more options.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Move Up'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''and Move Down'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; can also be applied to multiple selections.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If you have made a multiple selection, the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button will delete all the marked commands. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;plus &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''cursor keys'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will move the marked commands up or down.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Comment'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove a semicolon (;) in front of the command, to deactivate or reactivate the command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Command Only at Start/End'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove the text &amp;quot;Start_&amp;quot; or &amp;quot;End_&amp;quot; in front of the command. With these prefixes, the command will only be performed when the first file (&amp;quot;Start_&amp;quot;) or the last file (&amp;quot;End_&amp;quot;) in the file list is being processed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Single Step Mode'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Check this item to step through the batch, one command at a time. A dialog is opened after each command, allowing to run the next command, continue the batch without single steps, or stop running the batch. See the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'' “Pause''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;” command for further details.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;During a batch, press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changes in batch written to database'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Checked by default. If this item is unchecked, file display settings, such as Montage setting and Artifact correction display, are not written to the database. When the file is next opened in BESA Research, the settings made in the batch are not retained.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Leave files in the file list open after running the batch'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If this item is checked, files in the file list will remain open after the batch. This is useful, for instance, if you want to open a set of files, specifying the same montage and/or filter settings for each file.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to start running the batch. Each command is then applied in succession to each file in the File List.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that, while a batch is running press and hold down the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The log file ===&lt;br /&gt;
&lt;br /&gt;
A protocol of each batch is written to the log file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.txt.'''&amp;lt;/span&amp;gt; (e.g. C:\Users\Public\Documents\BESA\Research_7_1\Scripts\Log\Batch.txt)&lt;br /&gt;
&lt;br /&gt;
When you press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt; button, the file is opened in the Batch Log dialog. The Batch Log dialog will be opened automatically if there was an error during batch processing, unless you have used the ''BatchError'' batch command to suppress this behaviour.&lt;br /&gt;
&lt;br /&gt;
'''Backup of the log file'''&lt;br /&gt;
&lt;br /&gt;
When the log file is written, a backup of the previous version is written to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.txt.bak'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the size of the log file exceeds 200 KB, it is renamed to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.txt_date_time'''&amp;lt;/span&amp;gt; (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.txt_2004-10-08_10-53-32'''&amp;lt;/span&amp;gt;), and a new version of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.txt'''&amp;lt;/span&amp;gt; is created.&lt;br /&gt;
&lt;br /&gt;
=== Placeholders ===&lt;br /&gt;
&lt;br /&gt;
A powerful feature of the batch commands is the ability to define file names and specify standard paths using placeholders. These are text strings enclosed by percentage (%) signs. They can be used in all batch commands where file names are specified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Basename'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Placeholder !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; width=&amp;quot;10%&amp;quot;|'''%basename%'''&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|replaced by the basename of the currently opened file.&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%basename-n%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the last &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%-nbasename%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the first &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasename%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list (it has the same meaning as %basename% if no MAINFileOpen batch command was used in command list)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%base%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file without the path&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbase%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list without the path&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%ext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%basefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%t%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: time since start of batch on current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%T%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: current date and time&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%label%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Replace label of the most recent marked block by the block label, not including no. of averages&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%LABEL%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
| Replace label of the most recent marked block by the block label, including no. of averages&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%scripts%'''&lt;br /&gt;
|replaced by the path to the Scripts folder.&lt;br /&gt;
|&amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard MATLAB scripts used by BESA Research.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%montages%'''&lt;br /&gt;
|replaced by the path to the Montages folder.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%examples%'''&lt;br /&gt;
|replaced by the path to the Examples folder.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''%basename%''' -- replaced by the basename of the data file in the File List. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''%basename-n%''' -- replaced by the basename of the data file in the File List, but removing the last &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%-nbasename%''' -- replaced by the basename of the data file in the File List, but removing the first &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%scripts%''' -- replaced by the path to the Scripts folder (e,g, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard Matlab scripts used by BESA Research).&lt;br /&gt;
&lt;br /&gt;
* '''%montages%''' -- replaced by the path to the Montages folder.&lt;br /&gt;
&lt;br /&gt;
* '''%examples%''' -- replaced by the path to the Examples folder.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Placeholders for folders'''&lt;br /&gt;
&lt;br /&gt;
The following placeholders are the same as those used in the [Folders] section of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Besa.ini'''&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The strings enclosed by percent signs (%) are placeholders for the following folders in English-language versions of Windows. Folder names are different for the system and for other language settings. BESA Research will substitute the placeholders by the appropriate folder name for the Windows system and the system language:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 10 (English)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%localapp%''' = &amp;quot;&amp;quot;C:\Users[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;&amp;quot;Desktop[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%publicprog%''' = &amp;quot;Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;&amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Desktop\[User]\Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir%'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 7 (English):'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%localapp%''' = &amp;quot;C:\Users\[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;Desktop\[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%publicprog%''' = &amp;quot;C:\Users\Public\Public Documents\BESA\Research_7_1&amp;quot;. This folder is directly accessible from the Windows Explorer under &amp;quot;Libraries\Documents\Public Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;&amp;quot;Libraries\Documents\My Documents\Research_7_1&amp;quot; or &amp;quot;Desktop\[User]\My Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir% &amp;amp;nbsp;'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Batch Commands ===&lt;br /&gt;
&lt;br /&gt;
Batch commands are selected when the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt;&amp;quot; button is pressed in the &amp;quot;Batch&amp;quot; Tab. The commands are subdivided into five categories: General commands, commands for the Main module, for the Source Analysis module, imaging commands in the Source Analysis module, and commands for Time-Frequency Analysis. The commands have prefixes,''' GEN''', '''MAIN''',''' SA''', '''SAIMAGE''', and''' TFC'''), which identify the category. For compatibility with older program versions, old batches without the prefixes are accepted.&lt;br /&gt;
&lt;br /&gt;
Detailed descriptions of each batch command are available in the electronic help chapter “''Batch Processing and Combining Conditions / Batch Processing / Batch Commands”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands''' - prefixed with &amp;quot;'''GEN'''&amp;quot; (can be used anywhere):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot; style &lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| GENBatchError || used to change program behavior when errors occur&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENBatchWindowPosition&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the position of the batch window relative to the main window&lt;br /&gt;
|-&lt;br /&gt;
| GENComment || comment in the batch script: no batch functionality&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABcommand || send a command string to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABwaitForVariable || tells BESA to wait until Matlab has created a variable with the specified name.&lt;br /&gt;
|-&lt;br /&gt;
| GENPause || pause batch operations, allowing step-by-step operations&lt;br /&gt;
|-&lt;br /&gt;
| GENFor/GENEndFor|| a programming language-like FOR loop&lt;br /&gt;
|-&lt;br /&gt;
| GENRunProcess || runs a command-line process, e.g. an external program to perform part of the data analysis in the batch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENsaveBitmap&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SetVariable&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the value of the variable is inserted into subsequent batch commands where the text contains the name flanked by % signs&lt;br /&gt;
|-&lt;br /&gt;
| GENWindowPosition || set window size and positions to a selection of standard settings, e.g. for bitmap export&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for the Main Module''' - prefixed with &amp;quot;'''MAIN'''&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| MAINArtifactCorrect || run automatic artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactMethod || specify the method for artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactOn || turn artifact correction an artifact view on or off&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifact Scan || run an artifact scan as from the Paradigm Dialog&lt;br /&gt;
|-&lt;br /&gt;
| MAINAuxiliaryFiles || associate auxiliary files (e.g. *.''ela'', *.''sfp'') with the data file&lt;br /&gt;
|-&lt;br /&gt;
| MAINAverage || average the data&lt;br /&gt;
|-&lt;br /&gt;
| MAINBaseline || specify the parameters for baseline correction&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINDefineArtifactTopography&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || define an artifact topography&lt;br /&gt;
|-&lt;br /&gt;
| MAINEditDefaultEpoch || edit the default block epoch&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventRead || read events from an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventWrite || write events to an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINExport || export or append data in the selected target format&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINExportToBESAConnectivity&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || export data segments to BESA Connectivity&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFT || calculates the FFT spectrum of the marked data interval&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTmean || starts an averaging procedure that calculates the mean spectral properties in pre-defined regions&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTsave || saves FFT data (generated using the ''FFT Average option'' in the ''Average ''command) to disk (*.''fma)''&lt;br /&gt;
|-&lt;br /&gt;
| MAINFileOpen || close the current file and open a new file to which the remaining batch commands will be applied&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINFileClose&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || close the currently open file in a batch, provided it is not the current file in the File List&lt;br /&gt;
|-&lt;br /&gt;
| MAINFilter || set filters&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINfMRIArtifact&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns on the fMRI artifact removal&lt;br /&gt;
|-&lt;br /&gt;
| MAINGoTo || jumps with the cursor to the specified time point&lt;br /&gt;
|-&lt;br /&gt;
| MAINICA || starts ICA decomposition of data on the current screen &lt;br /&gt;
|-&lt;br /&gt;
| MAINICAsave || saves selected ICA components as topographies in a file&lt;br /&gt;
|-&lt;br /&gt;
| MAINICAselect || opens component selection dialog for managing ICA components&lt;br /&gt;
|-&lt;br /&gt;
| MAINImportASCII || import an ASCII file into a ''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'' file.&lt;br /&gt;
|-&lt;br /&gt;
| MAINMarkBlock || mark a data block (optionally send to Source Analysis)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMarkChannels&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || mark one or more channels, as given by the list&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMaxInInterval&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || within the current marked block, search for the largest absolute value on the specified channel&lt;br /&gt;
|- &lt;br /&gt;
| MAINMontage || change the montage (used by the Export command when saving to current montage)&lt;br /&gt;
|-&lt;br /&gt;
| MAINParadigm || load a paradigm file&lt;br /&gt;
|-&lt;br /&gt;
| MAINPatternToTrigger || convert a tag into a trigger&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINPolygraphicFilters&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || sets filters for polygraphic or added channels&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINScale&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set amplitude and time scales&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSearchAverageView&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start search average view&lt;br /&gt;
|-&lt;br /&gt;
| MAINSendToMATLAB || send data to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSplineConstant&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the spline constant used in spherical spline maps and channel interpolation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerRecode&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the command recodes a specified trigger number to a new number&lt;br /&gt;
|-&lt;br /&gt;
| MAINTriggerSelect || edit the trigger list (cf. ''Edit / Trigger Values''...)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerTagDelete&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || delete one or more triggers or tags&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewAverageBuffer&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turn on the Average Buffer View and place the specified buffer number to the left in the display&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewChannelType&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || select the channel type to display, and select channel types for mapping, export, etc&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewSelected&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns selected view on or off&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands for Source Analysis''' - prefixed with &amp;quot;'''SA'''&amp;quot; (but see also ''MarkBlock'', which is used to send a block of data to SA and open the SA window):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| SAAddSource || add a dipole or regional source to a model&lt;br /&gt;
|-&lt;br /&gt;
| SAChannelTypeForFit || switch between EEG, magnetometers or axial gradiometers, and planar gradiometers&lt;br /&gt;
|-&lt;br /&gt;
| SAConvertSource || convert a source from dipole to regional source, or from regional source to dipole&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalClara || run Cortical CLARA&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalLoreta || run Cortical LORETA&lt;br /&gt;
|-&lt;br /&gt;
| SADelete || delete current solution or all solutions or remove current fit interval or cursor&lt;br /&gt;
|-&lt;br /&gt;
| SADICS || start DICS computation (if DICS has been precomputed in the time-frequency image command)&lt;br /&gt;
|-&lt;br /&gt;
| SADisplayMRI || switch MRI display on/off and select small or large window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAElectrodeConfiguration&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || equivalent to pressing the Org or Std button in the Channel box of the Source analysis window&lt;br /&gt;
|-&lt;br /&gt;
| SAExit || close Source Module&lt;br /&gt;
|-&lt;br /&gt;
| SAFit || start fit&lt;br /&gt;
|-&lt;br /&gt;
| SAFitConstraint || set fit constraints, e.g. Residual Variance, Energy, Maximum Distance, Image Weighting, and their weights.&lt;br /&gt;
|-&lt;br /&gt;
| SAFitInterval || set fit or baseline interval&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAHeadModel&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the head model&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SALabelSource&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the label of the specified source number&lt;br /&gt;
|-&lt;br /&gt;
| SAMinimumNorm || run a minimum norm analysis&lt;br /&gt;
|-&lt;br /&gt;
| SANewSolution || open a new solution&lt;br /&gt;
|-&lt;br /&gt;
| SAOpenSolution || open a solution from a file&lt;br /&gt;
|-&lt;br /&gt;
| SAPCA || toggle PCA display of data or residual, and transfer a selected number of components to the source model&lt;br /&gt;
|-&lt;br /&gt;
| SARegularization || set the regularization values both for discrete and distributed source images&lt;br /&gt;
|-&lt;br /&gt;
| SASaveBitmap || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| SASaveLeadfields || save the leadfields of the current source model&lt;br /&gt;
|-&lt;br /&gt;
| SASaveModelWaveforms || save model waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveResidualWaveforms || save residual waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveRVandGFPWaveforms || save residual variance and global field power waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSolution || save the current solution&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceMontage || save a source montage&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceWaveforms || save source waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASendToMATLAB || send data, model, source waveforms, images, etc. to Matlab&lt;br /&gt;
|-&lt;br /&gt;
| SASetCursor || set the cursor&lt;br /&gt;
|-&lt;br /&gt;
| SASetDefaultSourceType || set the default source type (dipole or regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrActivateSource || Turn specified source on or off, or enable/disable source for fitting&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrientation || set orientation (of regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASwitchCondition || switch to a specified condition&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Distributed 3D Volume Images'''&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| SAIMAGEBeamformer || switch between Single Source and Bilateral Beamformer image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAIMAGEBeamformerTimeDomain&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start beamformer computation in the time domain&lt;br /&gt;
|-&lt;br /&gt;
| SAimageBrainAtlas || turns on the Brain Atlas overlay on volumetric image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGECLARA || generate CLARA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip image values under a threshold&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEExport || save the results of minimum norm or 3D imaging method&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEGotoMax || set the crosshair cursor at the nth maximum in the image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEImport || load a 3D volume image from file&lt;br /&gt;
|-&lt;br /&gt;
| SAimageImportFMRI || import fMRI image to Source Analysis Module&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELAURA || create LAURA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELORETA || create LORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESLoreta || create sLORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAimageSESAME || start SESAME computation&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESSLOFO || create SSLOFO image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEUser-Defined || create user-defined image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESaveLeadfields || save the leadfields of all the voxel sources in a 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESmooth || smooth current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESetCrosshair || set the position of the crosshair in the 3D image&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Time-Frequency Analysis''' ('''TFC''')&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot; &lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| TFCStartTFAnalysis ||(previously TFCgo) start TFC analysis using the current paradigm settings&lt;br /&gt;
|-&lt;br /&gt;
| TFCdisplay || change the TFC display (e.g. power/amplitude, coherence)&lt;br /&gt;
|-&lt;br /&gt;
| TFCsave || save numerical results to an ASCII file, or save a screenshot of the TFC window&lt;br /&gt;
|-&lt;br /&gt;
| TFCimage || start beamformer analysis on a selected time-frequency range&lt;br /&gt;
|-&lt;br /&gt;
| TFCSendToMATLAB || send TF results or single-trial data to MATLAB&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How to Average Your Data in a Batch  ===&lt;br /&gt;
&lt;br /&gt;
Using batch processing, several files from an experiment can be averaged at a time.&lt;br /&gt;
&lt;br /&gt;
Here we summarize the steps required:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Create the paradigm, and save the paradigm file.&lt;br /&gt;
* Open each individual data file to check the data:&lt;br /&gt;
** Make sure auxiliary files are defined and loaded properly, and the data are displayed correctly.&lt;br /&gt;
** Eyeball the data.&lt;br /&gt;
** Define bad (and interpolated) channels.&lt;br /&gt;
** Mark artifact time ranges.&lt;br /&gt;
** If required, set up artifact correction for the file.&lt;br /&gt;
** The data file can be closed again after this step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Preparing the batch'''&lt;br /&gt;
&lt;br /&gt;
* Open at least one&amp;amp;nbsp;file and select ''Process / Batch Scripts''.... The file(s) should be displayed in the file list. Alternatively, just select ''Process / Batch Scripts...,'' and add the files by&lt;br /&gt;
** pressing the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** dragging the files from Windows Explorer&lt;br /&gt;
** Opening a previously saved&amp;amp;nbsp;list with ''Load File List''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* You can delete files from the list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt;) or edit the file sequence using the right click context menu.&lt;br /&gt;
* Select the ''Batch Tab''.&lt;br /&gt;
* Add commands to your script. For averaging, these would normally be&lt;br /&gt;
** '''Paradigm''' -- to load the paradigm file&lt;br /&gt;
** '''Artifact Scan''' -- to run the artifact scan&lt;br /&gt;
** '''Average''' -- to perform the average&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Save these commands (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Test the commands on the files in the current file list: press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Look at the log file (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;) to check the results of averaging.&lt;br /&gt;
* Look at the data averages to make sure they have been done correctly.&lt;br /&gt;
* Repeat these steps until averaging is working properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Select ''Process / Batch Scripts''....&lt;br /&gt;
* Open the files you want to average in the batch in the file list:&lt;br /&gt;
** Any files that were open in BESA are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Edit the file list, e.g. delete unwanted files (use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; key or the right click context menu), or reorder the files (use &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl + cursor keys'''&amp;lt;/span&amp;gt; or context menu).&lt;br /&gt;
* Note that the order of files in the list specifies the order in which they will be processed in the batch script. This order will be important if all results are saved to the same target file. Otherwise the file sequence is not important.&lt;br /&gt;
* Optionally, save the file list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Select the ''Batch Tab'', and load the previously defined batch script with ''Load Batch''.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch.&lt;br /&gt;
&lt;br /&gt;
=== How to Merge and Compress raw data  ===&lt;br /&gt;
&lt;br /&gt;
Using the Export command in a batch, several data files can be merged into a single data file in BESA's data format (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.foc&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This can be useful if data from one subject have been collected in several data blocks, and you want to analyze all data blocks together.&lt;br /&gt;
&lt;br /&gt;
Optionally, to save space, data can be saved in compressed format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Files can be merged:'''&lt;br /&gt;
&lt;br /&gt;
* if they have identical channel configurations, or&lt;br /&gt;
* there are at least 16 EEG channels, and the export format is Standard 81 (i.e. EEG channels are interpolated to 81 standard locations). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''How to merge files:'''&lt;br /&gt;
&lt;br /&gt;
* Select '''Process / Batch Scripts...'''&lt;br /&gt;
* Add all the files that are to be merged to the file list:&lt;br /&gt;
** Any files that were open in BESA Research are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list (''Load File List'').&lt;br /&gt;
* Rearrange the files in the file list to the sequence in which they should be merged.&lt;br /&gt;
* Select the ''Batch Tab ''and insert an &amp;quot;''Export&amp;quot;'' command, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following dialog shows a possible configuration of the ''Export'' command:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The parameters shown in the Information box are the settings chosen in the ''Export Dialog'' when the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt; button has been pressed.&lt;br /&gt;
* '''Append if file already exists''' must be checked in order to merge the files.&lt;br /&gt;
* The '''target file name''' must be fixed, i.e. don't use the '''%basename%''' variable, because that will result in a different target file name for each source file.&lt;br /&gt;
* There are two variables that can be used for the segment label:&lt;br /&gt;
** '''%filename%''' will insert the basename of the source file into the segment label.&lt;br /&gt;
** '''%c%''' will insert the file number into the segment label. The number gives&amp;amp;nbsp;the position of the file in the file list. For instance, &amp;quot;File %c%&amp;quot; will generate the label &amp;quot;File 2&amp;quot; for the second file in the list.&lt;br /&gt;
&lt;br /&gt;
=== Example: Data averaging in the auditory intensity experiment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, two raw data files, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;, from the auditory intensity experiment will be batch averaged.&lt;br /&gt;
&lt;br /&gt;
Please note that there are further tutorials covering this experiment. The first file is contaminated by many eyeblinks, and more epochs would be averaged if eye correction were used (see Viewlet demonstration on artifact correction on the BESA website). However, in this tutorial, we will just use artifact rejection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Various ways of creating a File List'''&lt;br /&gt;
&lt;br /&gt;
1. '''Files that were open in BESA Research are automatically added to the File List.''' Start BESA Research and open the files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt '''&amp;lt;/span&amp;gt;in the directory ''Examples\ERP-Auditory-Intensity''.&lt;br /&gt;
&lt;br /&gt;
2. Select ''Process / Batch Scripts''.... You should see the file names in the '''''File List Tab''''' something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. You can resort the files in the file list alphabetically by clicking onto the '''''File List column header''''':&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can mark any file, hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;key and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrow '''&amp;lt;/span&amp;gt;to move the file name up or down the list. This is the sequence in which files will be processed in the batch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; and save the list you have created to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Highlight both names and press the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
6. '''Files can be dragged from Windows Explorer'''. Start Windows Explorer and navigate to the ''ERP-Auditory-Intensity'' subdirectory of your BESA Research examples folder (located in the ''Public Documents'' folder of your computer). Click on &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and drag it with the mouse onto the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''''File List Tab'''''. Let go of the mouse. BESA Research opens the file, and displays the name in the File List. Repeat for &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt.'''&lt;br /&gt;
&lt;br /&gt;
7. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
8. '''Files can be added using the ''Add File'' button'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; and navigate to the ''Examples\ERP-Auditory-Intensity'' subdirectory. Select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt;. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl'''&amp;lt;/span&amp;gt; and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;. Both names should then be displayed in the ''File Open'' dialog. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to add the files to the file list.&lt;br /&gt;
&lt;br /&gt;
9. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
10. '''Files can be loaded from a previously saved file list'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List '''&amp;lt;/span&amp;gt;and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;, the list you saved in step 6 above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Setting up the batch'''&lt;br /&gt;
&lt;br /&gt;
1. We will add three commands, '''Paradigm''', '''Artifact Scan''', and '''Average''', to create a batch that will be applied to the two files in the file list.&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''Batch Tab'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button to obtain the ''Select Command'' window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (9).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt; and then on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; (alternatively, double-click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt;). Hit &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Browse'''&amp;lt;/span&amp;gt;, navigate to the ''Auditory'' folder, and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''AEP_Intensity.pdg'''&amp;lt;/span&amp;gt;, the paradigm for the auditory intensity experiment.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (10).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to obtain the ''Load Paradigm Task'' window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (11).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;, and the first task in the batch is ready, and listed in the Batch Command window. If you want to modify the command, double-click on it to open the above window, that allows to browse for a different paradigm file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (12).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Next, we add the '''Artifact Scan''' command. Click on the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select ''Artifact Scan.''&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (13).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Artifact Scan Task'' window. We want to be able to view the results of the scan, and adjust thresholds and bad channels if necessary. Therefore, check the ''Wait after scan'' checkbox.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (14).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to close the ''Artifact Scan Task'' window. Our batch now contains two commands.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (15).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Finally, we will add an '''Average''' command. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button and select ''Average''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Average Task ''window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (16).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. With the default settings, the average would be saved to the same directory as the data. The file name mask is set by default so that in this example the two averages would be saved to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1-av.fsg '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2-av.fsg'''&amp;lt;/span&amp;gt;. We will save the averaged files to subdirectory ''&amp;quot;Averages''&amp;quot; of the data directory. Uncheck the ''Use default target'' check box, change the File name mask to '''%basename%_av-test''' in order not to overwrite the predefined files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (17).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Average Task'' window. Our batch is now complete.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (18).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
13. We will now save the batch so that it can be used again. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt; button, and save to the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-ex1.bbat'''&amp;lt;/span&amp;gt;. Note that an easy way to generate new averaging batches is to load a previously save batch and edit the commands -- it may only be necessary to edit the '''Paradigm''' command to select the relevant paradigm file, and maybe to adjust the target directory in the '''Average''' command.&lt;br /&gt;
&lt;br /&gt;
14. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch'' Window to start the batch running. As requested, the batch pauses after the artifact scan:. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (19).gif]]&lt;br /&gt;
&lt;br /&gt;
You may now adjust the number of rejected trials, e.g. by moving the vertical red bar to the left or exclude bad channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to continue with averaging.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (20).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
16. Note that, in the background, the ''Batch Running'' window is providing feedback about the current file and current task.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
17. The batch will stop again after the next artifact scan. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to allow the batch to run to the end.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (21).gif|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
18. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log'''&amp;lt;/span&amp;gt; to view the batch log.&lt;br /&gt;
&lt;br /&gt;
19. The batch log gives feedback about the number of epochs that were averaged for each file.&lt;br /&gt;
&lt;br /&gt;
20. Finally, press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to return to the main BESA Research display. Open the averages in the ''Averages'' subdirectory to confirm that they were generated properly.&lt;br /&gt;
&lt;br /&gt;
=== Example: Merging files using the Export Command ===&lt;br /&gt;
&lt;br /&gt;
Here we will demonstrate the use of the '''Export '''command to merge two files. We will combine the two averages from the previous example (Data averaging in the auditory intensity experiment) into one target file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Generate the file list'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and load the two data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av-test.fsg'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2_av-test.fsg'''&amp;lt;/span&amp;gt; that were saved in the previous example.&lt;br /&gt;
# Select ''Process / Batch Scripts....''The two file names should be displayed in the file list.&lt;br /&gt;
# In the file list, make sure that &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1_av-test.fsg '''&amp;lt;/span&amp;gt;is the first file in the list. If it is not, highlight the file, and move it up using &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl+up'''&amp;lt;/span&amp;gt;, or right click and select ''Move Up'' in the context menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Generate the batch'''&lt;br /&gt;
&lt;br /&gt;
1. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select the '''Export''' command.&lt;br /&gt;
&lt;br /&gt;
2. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Export Task'' window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (24).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt;... button to open the ''Export Dialog''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (25).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Since we are combining averages, select ''Hires (no compression)'' in the '''Target data format''' drop-down list (If we were merging raw data files, it is better to select compression. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the dialog. Check'' Append if file already exists'', so that the files will be merged. Enter '''s1+s2''' in the target file name mask edit box. This ensures that both files will be saved to the same target: &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (26).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Export Task'' window. The '''Export '''command is displayed. &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (27).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Optionally, you may save the batch file by pressing &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
7. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch, and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch Completed'' window to return to the BESA main window.&lt;br /&gt;
&lt;br /&gt;
8. Finally, open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt; to confirm that it contains the two merged files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Merge raw data'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Repeat the above task to merge the two raw data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2.cnt'''&amp;lt;/span&amp;gt; into a single target file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.foc'''&amp;lt;/span&amp;gt;. In this case, select one of the compression options as the target data format. Note that you would not normally want to merge two files from different subjects. However, several data blocks from the same subject can conveniently be merged using this method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; files can also be merged using the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''Combine Conditions''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; dialog. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions, Channels ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Combine Condition Scripts ===&lt;br /&gt;
&lt;br /&gt;
With the Combine-Conditions module you can do a variety of operations on BESA averages (files with the extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, and other segment files, such as &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.mul&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.swf&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* Create grand averages&lt;br /&gt;
* Combine averages (add, subtract, weighted/unweighted)&lt;br /&gt;
* Merge files&lt;br /&gt;
* Exclude unwanted averages&lt;br /&gt;
* Rename conditions&lt;br /&gt;
* Rename or resort channels&lt;br /&gt;
* Generate averages or differences over selected channels&lt;br /&gt;
* Transform the data: standard interpolated 81 electrodes, change sampling rate, change interval&lt;br /&gt;
* Determine peaks, mean amplitudes, or integrals on data averages&lt;br /&gt;
* These operations can be performed on one or more files simultaneously. Results of an operation are stored in a single target file.&lt;br /&gt;
&lt;br /&gt;
The module includes four tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* File List: Define a list of files on which the operations will be performed.&lt;br /&gt;
* Condition List: List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
* Channel List: List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
* Run Scripts: Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak analysis). Start the operation.&lt;br /&gt;
* Note that in all four tabs, configurations can be saved for future use, and the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button restores the most recently used configuration.&lt;br /&gt;
&lt;br /&gt;
=== Condition List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
&lt;br /&gt;
The first column of the&amp;amp;nbsp;list box shows a list of all the condition names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the source conditions. Columns define the target conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each condition name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target conditions will have the same name as source conditions. Right click on source condition labels to view properties (e.g. no. of samples, time range, sampling rate).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (28).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the condition list'''&lt;br /&gt;
&lt;br /&gt;
* Target condition names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: conditions can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over conditions, the sum is divided by the number of conditions or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;''Divide the result by the sum of PLUS factors''&amp;quot; is unchecked, the conditions will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between conditions, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the condition list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Weighting of averages'''&lt;br /&gt;
&lt;br /&gt;
* Below the list, click on the ''Weighted Average'' row to toggle &amp;quot;YES&amp;quot; and &amp;quot;NO&amp;quot;. &amp;quot;YES&amp;quot; means that averages will be weighted by the number of epochs contributing to the average. For instance, if average A contained 100 epochs and average B contained 200 epochs, the weighted average will be computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(100 * A + &amp;amp;nbsp;200 * B) / (100 + 200)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Select &amp;quot;NO&amp;quot; for an unweighted average. For the above example, the average is computed as&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(A + B) / 2&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Weighted averages are not permitted if one of the boxes contains a negative value.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Values other than +1 or -1 in the boxes apply a different kind of weighting. For instance, we want to compute the difference between the means of conditions A, B, C and D, E. Use a right-click to specify the fraction 1/3 for each of A, B, and C, and -1/2 for each of D and E (see example below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (29).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Feedback'''&lt;br /&gt;
&lt;br /&gt;
* Conditions that have different numbers of electrodes (averaging across different files) can only be combined if channels are interpolated to a standard set of electrodes.&lt;br /&gt;
* Conditions that have different durations or sampling rates can only be combined if the sampling rate and durations are made the same.&lt;br /&gt;
* Feedback about the above situations is displayed by the presence of tick marks above the list box.&lt;br /&gt;
&lt;br /&gt;
=== Channel List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
&lt;br /&gt;
Note that this tab is very similar in usage to the '''Condition List Tab'''. Note also that some of the functions performed in this tab could also be done in the Montage Editor. It may be a matter of convenience whether you choose to perform these operations here or in the Montage Editor.&lt;br /&gt;
&lt;br /&gt;
The first column of the list box shows a list of all the channel names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the ''source'' channel. Columns define the'' target'' channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each channel name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target channel will have the same name as source channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Combining files'''&lt;br /&gt;
&lt;br /&gt;
If files with different channel configurations are included in the File List, the rows and columns of the Channel List Tab will only contain the labels for the channels that are in common among the files.&lt;br /&gt;
&lt;br /&gt;
If the files in the File List have a different sequence of channels, the sequence of the first file in the list will be adopted in the Channel List.&lt;br /&gt;
&lt;br /&gt;
Thus, for the initial setting, unless the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked, the target grand average or peak/amplitude analysis, etc. will be applied using only channels that are in common among the input files, and using the channel sequence of the first file in the File List. By changing the target channels or by changing the entries in the Channel List, new channels consisting of averages or differences can be generated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''What can the Channel List be used for?'''&lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
&lt;br /&gt;
* Reorder or relabel channels&lt;br /&gt;
* Create channel differences&lt;br /&gt;
* Create averages over channel groups, e.g. for peak analysis&lt;br /&gt;
* Extract a selection of channels for peak analysis or mean amplitudes&lt;br /&gt;
* Create grand averages across files with different channel configurations, just using channels in common among the files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (30).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the channel list'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Target channel names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: channels can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over channels, the sum is divided by the number of channels or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;Divide result by the sum of PLUS factors&amp;quot; is unchecked, the channels will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between channels, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the channel list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Channel List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Channel List&amp;amp;nbsp;'''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
=== Run Scripts Tab ===&lt;br /&gt;
&lt;br /&gt;
Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak detection. Start the operation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load or Save Settings'''&lt;br /&gt;
&lt;br /&gt;
* You can save the current settings of this tab to a file (*.run) which can be loaded later.&lt;br /&gt;
* When you run the script, the current settings are saved automatically to a file &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* Press this button to load the previous settings (from &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Averages to Generate'''&lt;br /&gt;
&lt;br /&gt;
* '''Generate separate averages for each source file'''. Averages are performed over conditions within the source file, and are then appended to the target file.&lt;br /&gt;
* '''Combine data from source files'''. Conditions are combined over all source files into a single target average.&lt;br /&gt;
* '''No averages, just copy'''. Files are copied and merged to the target file. Use this option for renaming conditions, merging files, removing unwanted averages (see below), changing the sampling rate and interval.&lt;br /&gt;
* '''Peaks and mean amplitudes'''. Specify time ranges for peaks, mean amplitudes, or integrals (areas).&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note: When generating or copying averages (first three options), filters and baseline settings are turned off. For Peaks and mean amplitudes, filters and baseline settings are specified in the dialog.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Spatial Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Interpolate to Standard 81 electrodes'''. The target file will contain only electrodes (other channels are omitted), using the Standard 81 configuration (as in other export functions within BESA Research). This cannot be selected if the source data contain less than 16 EEG channels.&lt;br /&gt;
* '''Interpolate Bad Channels'''. Bad electrode channels in the source file will be interpolated. If the above option is deselected and bad channels exist in one or more of the source files, this option is always on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;BESA Research can interpolate EEG, and MEG if the sensors are axial gradiometers or magnetometers. If other channels are marked as bad in one or more of the source files, these will be defined as bad in the target file. This applies to MEG planar gradiometers, to polygraphic data, and to ICR channels.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Temporal Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Spline to New Sampling Rate and Interval'''. Data can be converted to a new sampling rate, and the interval can be changed.&lt;br /&gt;
** If the sampling rate is reduced, the data will be low-pass filtered at 1/3 sampling frequency before reduction.&lt;br /&gt;
** If the sampling interval is changed, the prestimulus and poststimulus intervals are limited by the smallest intervals in the conditions contributing to the averages. These limits are shown below the edit boxes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks and Mean Amplitudes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (31).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range between which peaks are to be determined.&lt;br /&gt;
* Select the montage on which the peaks are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Define the baseline settings.&lt;br /&gt;
* Specify whether peaks are to be defined at one latency: if so, select the channel on which peaks are to be detected.&lt;br /&gt;
* Specify whether you want to find positive or negative peaks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Mean amplitudes and areas:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range over which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Select the montage on which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Note that when computing areas, data are first rectified (made positive) and then summed over the time range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Output options of the analysis:'''&lt;br /&gt;
&lt;br /&gt;
* A single ASCII file that contains the result of the analysis for all data sets, conditions, and channels including header and information lines.&lt;br /&gt;
* A sparse output suitable for import in SPSS. Each variable (e.g. a latency, a channel amplitude) constitutes one column of the output file.&lt;br /&gt;
* Direct transfer to MATLAB into a struct besa_peak. For more information on the data transfer from BESA Research to MATLAB, please refer to help chapter ''“The MATLAB interface”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Starting the Operation'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;to start the operation. After the operation is completed, and the &amp;quot;Open target file in BESA&amp;quot; box is checked, BESA Research will open the target file. &amp;amp;nbsp;&amp;quot;Open target file in BESA&amp;quot; cannot be checked if &amp;quot;Peaks and mean amplitudes&amp;quot; was selected - then the result of the operation will be an ASCII file or a MATLAB transfer.&lt;br /&gt;
* You will be asked for the name of the target file (unless a MATLAB transfer of peak data has been performed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Restrictions'''&lt;br /&gt;
&lt;br /&gt;
* Depending on source file configurations, not all options above are selectable. For instance, if two files contain different numbers of electrodes, and the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked in the '''''Channel List''''' Tab, spatial interpolation to Standard 81 is enforced in the target. Similarly, if different sampling rates are used in different files, temporal interpolation is enforced.&lt;br /&gt;
* You are not allowed to add files to the file list if the channel configuration is different, and the data cannot be combined with Standard 81 interpolation. Since Standard 81 interpolation is only possible for EEG, multiple files without EEG can only be loaded if they have the same number of channels.&lt;br /&gt;
&lt;br /&gt;
=== How to Create Grand Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to average in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To average across different conditions, click in the list boxes to obtain &amp;quot;+1&amp;quot; for each source condition to combine, and rename the target condition to define a meaningful name for the average.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Generate Differences Between Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To create differences, click in the list boxes to obtain &amp;quot;+1&amp;quot; for one of the source conditions, and &amp;quot;-1&amp;quot; for the source condition to subtract, and rename the target condition to define a meaningful name for the difference.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. An average of the differences is generated. If only one example of each condition exists, e.g. in a grand average file, the result is the difference between conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Merge Files ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to merge in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notes'''&lt;br /&gt;
&lt;br /&gt;
* If the source files have different electrode configurations, use the Standard 81 configuration for the target.&lt;br /&gt;
* If the source files have different sampling rates or intervals, use Temporal Interpolation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Remove Unwanted Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted segments'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as averages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted conditions (by label)'''&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Deselect the target conditions you want to omit (replace the &amp;quot;+1&amp;quot; by a blank).&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as artifacts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Rename Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. Click on column headings to rename the target conditions.&lt;br /&gt;
* Click on the''' Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data with the renamed conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Change the Sampling Rate ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file(s) you want to change in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...'').&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Select &amp;quot;''Spline to New Sampling Rate and Interval''&amp;quot; and type the new sampling rate into the edit box.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Create grand average and combinations of conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, we will generate a grand average of the results of the Auditory Intensity Experiment. The experiment includes averages from five different stimulus intensities. We will create a grand average over each intensity, but also include means over the two lowest and the two highest intensities, and the difference between these two combinations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av.fsg - S10_av.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The files contain the individual averaged data of the 10 subjects who participated in this study.&lt;br /&gt;
# Select ''ERP / Combine Conditions...'' The file list should display the two files, with feedback about the number of averages and conditions. 8 epochs are found. See the ''“Data averaging in the auditory intensity'' ''experiment”'' example for examples how to manipulate the file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (32).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. The initial window defines target conditions with the same name as the source conditions. To generate the grand average over these conditions we could proceed without further changes to the '''Run Scripts Tab'''. However, we want to modify the condition list and create a condition that contains the grand averaged difference between the''' High''' and '''Low''' conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''All '''column label. In the resulting window, rename condition '''All''' to''' Difference'''. Then press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (33).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. The last column is now labeled '''Difference.''' Left-click twice onto the ‘'''+1’''' entry that links this condition to the '''All '''input condition. This will remove the link and leave the field blank. To define the ‘Difference’ condition as the average of ‘High’ minus ‘Low’ over subjects, left-click once into the field linking input '''High''' with target '''Difference''' to generate an entry ‘'''+1’''' in this field. Left-click twice into the field linking input '''Low '''with target '''Difference''' to generate an entry '-'''1'''’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;[[Image:Batch processing (35).gif]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; and save the list to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ER&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;P-aud-ex1.clist'''&amp;lt;/span&amp;gt;. This condition combination can thus be loaded later using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Click on the '''Run Script Tab'''.&lt;br /&gt;
# The default tab settings are ready for generating the grand average ('''Combine data from source file''' and '''Open target file in BESA''' should be checked). Just press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Enter &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_cc-test.fsg'''&amp;lt;/span&amp;gt; as file name and press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Save'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The resulting file contains the 8 target conditions, 60db, 70dB, 80dB, 90dB, 100dB, Low, High, and Difference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Average files from different experiments ===&lt;br /&gt;
&lt;br /&gt;
This example is intended to illustrate several features of the ''Combine Conditions'' Dialog, such as electrode interpolation and resampling. We will combine an average from the Auditory Intensity experiment with one from the P300 auditory experiment. In this particular case, it is not a very meaningful thing to do, but it shows what is possible. For instance, the same experiment may have been performed using different sampling rates or electrode combinations. This example shows how such data may be combined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_GA.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The file contains the grand average data from the auditory intensity experiment.&lt;br /&gt;
# Open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''RareFrequentResponseLeft.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-P300-Auditory'' folder. This file contains averages from the P300 auditory experiment.&lt;br /&gt;
# Select ''ERP / Combine Conditions... ''Note that the files have different sampling rates and different numbers of electrodes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (36).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. Note that the feedback text at the bottom of the window displays the text &amp;quot;Standard 81 interpolation required to generate average; Across files: resampling or change in time range required to generate average&amp;quot;. The condition labels show all the names from both files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (37).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.  We will exclude most conditions, and just combine the most similar conditions from the two experiments: the &amp;quot;Standard&amp;quot; and the &amp;quot;80dB&amp;quot; conditions. Click on the title of the first column,''' Blink'''. Select “''Delete all conditions to the right of this column”'', and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (38).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on the title again, and rename the target condition to &amp;quot;Standard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (39).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click twice in the first line to remove the &amp;quot;+1&amp;quot; entry there. Click once in the third row (&amp;quot;Frequent&amp;quot;), and in the 7th row (&amp;quot;80dB&amp;quot;), to display &amp;quot;+1&amp;quot; at each entry. Thus, just two of the conditions will be combined into one target condition.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (40).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Run Script Tab'''. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (41).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Note that '''Interpolate to Standard 81 electrodes''' is checked and grayed: since two different electrode sets are to be combined, we can only do this by interpolating electrodes. Also, both '''Spline to new sampling rate''' and '''Clip interval '''are checked and grayed. Again, these settings are required in order to be able to average the two data files together. The sampling rate is set to the higher of the two selections. The time range is set to the largest possible range that can be clipped from the two data sets. For now, leave these settings as they are, and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Save the target to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''TestCombineExpts_CC-std81.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Spectral_Analysis</id>
		<title>BESA Research Spectral Analysis</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Spectral_Analysis"/>
				<updated>2021-11-02T12:42:53Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==  Spectral Analysis - Introduction ==&lt;br /&gt;
&lt;br /&gt;
There are two different types of spectral analysis in BESA Research:&lt;br /&gt;
&lt;br /&gt;
# A '''Fast Fourier Transform (FFT)''' computes the total spectral content of a certain data interval, usually a few seconds or minutes long. This interval can be&lt;br /&gt;
#* a short data block of interest, typically a few seconds&lt;br /&gt;
#* an extended time range, e.g. between two markers or the whole data file ('mean FFT')&lt;br /&gt;
# '''Density spectral arrays (DSA)''' provide an overview of the temporal evolution of spectral activity over longer epochs (here: 15, 20 or 30 minutes) or the whole data file. DSA is useful for reviewing long recordings, since epochs where changes of frequency distribution or amplitudes occur can be identified at a glance.&lt;br /&gt;
&lt;br /&gt;
== FFT ==&lt;br /&gt;
&lt;br /&gt;
The Fast Fourier Transformation (FFT) can be applied to a marked region, the data displayed on the screen, over a larger time range in the data between two markers, over marked epochs, or the whole EEG, in order to examine the frequency content of a signal. Results of the FFT can be viewed in a variety of ways, including amplitude and power spectra, amplitude and power in frequency bands, and these results may be printed or written to data files in ASCII format. The previously calculated FFT spectrum may be redisplayed. The current FFT can be saved to a binary file and reloaded. Topographic maps of amplitude, power, and phase can be plotted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''FFT Computation and Display'''&lt;br /&gt;
&lt;br /&gt;
Two FFT computations are available in BESA Research:&lt;br /&gt;
&lt;br /&gt;
* [[#FFT over a short data block of interest | The FFT over a short data block of interest]]&lt;br /&gt;
* [[#Mean FFT Spectrum over an extended time range | The Mean FFT over an extended time range]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FFT over a short data block of interest ===&lt;br /&gt;
&lt;br /&gt;
To start an FFT calculation, highlight a data block by left mouse click and drag. If no block is highlighted, the FFT will be performed over the time range shown on the display. Apply one of the following:&lt;br /&gt;
&lt;br /&gt;
# Right-click into the marked block and select the item ''FFT''.&lt;br /&gt;
# Type the HotKey &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''F'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Select the item ''FFT-Spectrum'' in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process'''&amp;lt;/span&amp;gt; menu (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+P, F'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (2).gif ]] &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; [[Image:Spectral (1).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' It is not possible to select the FFT process if the region to be processed contains less than 128 samples. This can occur, for instance, if the time range of a highlighted region is too short.&lt;br /&gt;
&lt;br /&gt;
'''Note''': When an FFT is selected, BESA Research displays the results for the current montage on the screen. In the background, the program also performs the FFT on 81 standard interpolated, average referenced channels in the case of EEG and on the average referenced data in the case of MEG. When FFT results are saved to a file, you have the choice of saving either the current montage or the 81 interpolated, average referenced channels (only for EEG). Maps of the FFT results are always based on the average referenced data. This is necessary to ensure that electrodes are given equal weights in the nonlinear transformation to power or amplitude (= root of power).&lt;br /&gt;
&lt;br /&gt;
For an FFT over a marked block or the whole screen, no parameters have to be specified. Internally, BESA Research preprocesses the selected data segment for the FFT in two steps:&lt;br /&gt;
&lt;br /&gt;
# A window function is multiplied with the data to attenuate the amplitudes at the ends to zero&lt;br /&gt;
# The number of samples is increased by interpolation (if necessary) to make it a power of 2.&lt;br /&gt;
&lt;br /&gt;
This preprocessing of a highlighted data segment is illustrated in the figure below:&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
The highlighted block constitutes 80% of a window of width 100%. A cosine squared (cos²) window of width 20% of the total is applied at the edges, so that the signal amplitude is attenuated to 50% at the edges of the marked block, and zero at the edges of the window. Then we take the number of time samples in the window and select the next higher power of 2 (up to 2^15 = 32768). Using spline interpolation, the data in the window are converted to this larger number of points, and the FFT is applied. If the number of points is greater than 32768, spline interpolation is used to reduce the number to 32768. In this case, to avoid aliasing, the data are low-pass filtered at a frequency corresponding to ¼ of the new sampling rate.&lt;br /&gt;
&lt;br /&gt;
If the FFT is applied to the data displayed on the screen, windowing is similar to that for the highlighted block, except that no data outside the block are included: the cosine squared window is applied so that the signal amplitude is attenuated to zero at the edges of the display.&lt;br /&gt;
&lt;br /&gt;
=== Mean FFT Spectrum over an extended time range ===&lt;br /&gt;
&lt;br /&gt;
To start a mean FFT over an extended time range, e.g. between markers or over the whole data file, select the item ''Mean FFT-Spectrum'' in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process'''&amp;lt;/span&amp;gt; menu (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+P M'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[[Image:MeanFFT_Dialog.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the upper section of the ''Mean FFT'' dialog box the range on which the FFT is performed can be set:&lt;br /&gt;
&lt;br /&gt;
# on the whole EEG&lt;br /&gt;
# on all marked epochs within the EEG&lt;br /&gt;
# on all marked epochs with a specific label&lt;br /&gt;
# on a time range delimited by two markers&lt;br /&gt;
# on all epochs delimited by two markers&lt;br /&gt;
# over triggers generated by the ERP module; mean FFT over triggers is only available if the mean FFT is called from the ERP module&lt;br /&gt;
&lt;br /&gt;
Ranges that are not currently available (e.g. if no epochs or no markers are defined) are greyed out.&lt;br /&gt;
&lt;br /&gt;
The mean FFT consists of a set of FFTs from overlapping data segments spanning the selected time range. Each data segment has a fixed width, defined as a power of 2 sampling points, that can be selected under &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Block Size / Points per Block'''&amp;lt;/span&amp;gt;: In the center of the options window, the number of points per FFT block is selected. Selection can be 128, 256, 512, or 1024 points. The block width influences in particular the contribution to the spectrum of low frequencies: the wider the block, the lower the frequencies that can be represented. The lowest frequency is given by 1/(block width in seconds). Thus, if you have recorded data with a high sampling rate, a wider window is necessary to compute low frequencies. Note: For each block size in samples, the corresponding width in seconds is specified in brackets.&lt;br /&gt;
&lt;br /&gt;
The lower section of the options window determines amplitude and gradient thresholds for including a block in the mean FFT. If signal amplitudes exceed the amplitude threshold or the difference of two consecutive signal amplitudes exceeds the gradient threshold, the block will be omitted. Different thresholds may be set for each channel type (in the above example, scalp and polygraphic channels).&lt;br /&gt;
&lt;br /&gt;
Press '''OK''' in the options window to start the computation of the mean FFT. Computation can be interrupted by pressing any key. The interrupt has to be confirmed and may be cancelled to resume the mean FFT calculation.&lt;br /&gt;
The section “FFT Covariance” allows to compute the FFT covariance over the data range selected.&lt;br /&gt;
If the check box “Covariance Spectrum” is checked, a text file (BESA vectorized ASCII format) will be written after the computation. The file can be loaded into BESA Research again or can be analysed externally.&lt;br /&gt;
The file has the naming convention: [basename]FFTCovSvdBack_[MtgName].avr&lt;br /&gt;
Internally, the mean FFT is performed over the current montage. The covariance matrix is computed in frequency space.&lt;br /&gt;
The steps are:&lt;br /&gt;
For each epoch to be added to the mean covariance matrix:&lt;br /&gt;
# Average reference for EEG, MAG, and GRA data (if the single montage channels box is not checked)&lt;br /&gt;
# Resample data to 256 Hz&lt;br /&gt;
# Compute FFT&lt;br /&gt;
# Add to FFT covariance matrix (either sum over all channels, or individually for each montage channel if that box is checked)&lt;br /&gt;
Then, a singular value decomposition is performed on the FFT covariance of each channel, to obtain the (complex) eigenvectors. The newly arranged matrix of eigenvectors is then inverse Fourier transformed to obtain waveforms for each of the components. These are written to file.&lt;br /&gt;
&lt;br /&gt;
Note on computational steps: Each data segment overlaps 50% with the next segment and is multiplied by a cosine squared (cos² window, as shown at the bottom of the figure below). This combination of overlap and windowing ensures that each time point contributes equally to the mean spectrum (since cos²(x) + sin²(x) = 1). Because mean spectra are computed, phase information is not available.&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''' that time ranges marked as artifacts are not included in the computation of the mean FFT. These time ranges are not excluded when computing the FFT of a marked block or of the displayed data.&lt;br /&gt;
&lt;br /&gt;
The section “FFT Covariance” allows to compute the FFT covariance over the data range selected. &lt;br /&gt;
&lt;br /&gt;
If the check box “Covariance Spectrum” is checked, a text file (BESA vectorized ASCII format) will be written after the computation. The file can be loaded into BESA Research again or can be analysed externally.&lt;br /&gt;
&lt;br /&gt;
The file has the naming convention: [basename]FFTCovSvdBack_[MtgName].avr&lt;br /&gt;
&lt;br /&gt;
Internally, the mean FFT is performed over the current montage. The covariance matrix is computed in frequency space.&lt;br /&gt;
&lt;br /&gt;
The steps are: &lt;br /&gt;
For each epoch to be added to the mean covariance matrix:&lt;br /&gt;
    1) Average reference for EEG, MAG, and GRA data (if the single montage channels box is                                &lt;br /&gt;
       not checked)&lt;br /&gt;
    2) Resample date to 256 Hz&lt;br /&gt;
    3) Compute FFT&lt;br /&gt;
    4) Add to FFT covariance matrix (either sum over all channels, or individually for      &lt;br /&gt;
       each montage channel if that box is checked)&lt;br /&gt;
&lt;br /&gt;
Then, a singular value decomposition is performed on the FFT covariance of each channel, to obtain the (complex) eigenvectors. The newly arranged matrix of eigenvectors is then inverse Fourier transformed to obtain waveforms for each of the components. These are written to file.&lt;br /&gt;
&lt;br /&gt;
=== Redisplaying the previous FFT ===&lt;br /&gt;
&lt;br /&gt;
The results of the previously calculated FFT spectrum can be redisplayed by selecting the item ''Previous FFT-Spectrum'' in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process '''&amp;lt;/span&amp;gt;menu or by typing the hotkey &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl+F'''&amp;lt;/span&amp;gt;. It is not possible to recall the previous FFT if there was a change in&lt;br /&gt;
&lt;br /&gt;
* the montage for which the FFT was calculated&lt;br /&gt;
* additional or artifact channels&lt;br /&gt;
* bad or interpolated channels&lt;br /&gt;
* the channel configuration&lt;br /&gt;
&lt;br /&gt;
after the last FFT was calculated.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Mapping the Results of the FFT&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Amplitude, power, mean band amplitude or power, and phase delays can be mapped. How to map FFT results is described in the chapter &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''&amp;quot;Mapping / FFT Mapping''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FFT 'View' Menu: Adjusting the FFT Display ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The FFT spectrum of each channel in the '''current montage''' is displayed in a window on the left of the screen. At the bottom is the frequency scale. To the right, the dominant frequency is shown for each channel, together with the amplitude or power at this frequency. The dominant frequency is determined between the lower boundary of the first frequency band and the maximum displayed frequency.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (7).gif ]]&lt;br /&gt;
&lt;br /&gt;
''FFT result window with a display of amplitude spectrum with the sum of amplitudes in bands, color coding, and frequency range 1-30 Hz. The montage is TR_Temporal Region.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View'''&amp;lt;/span&amp;gt; Menu, the following options can be selected:&lt;br /&gt;
&lt;br /&gt;
* Results can be displayed as &amp;lt;u&amp;gt;'''A&amp;lt;/u&amp;gt;mplitude''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+V A'''&amp;lt;/span&amp;gt;) or &amp;lt;u&amp;gt;'''P&amp;lt;/u&amp;gt;ower''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+V&amp;amp;nbsp;P)'''&amp;lt;/span&amp;gt; spectra. At the top of the display (cf. example below) is the text ''&amp;quot;Amp. Spectrum&amp;quot;'' or'' &amp;quot;Power Spectrum&amp;quot;. ''Click on the text to toggle between the two types of display.&lt;br /&gt;
* The graphical display of amplitude or power spectra can be &amp;lt;u&amp;gt;'''N&amp;lt;/u&amp;gt;ormalized''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+V N'''&amp;lt;/span&amp;gt;), such that all displayed values are scaled relative to the dominant frequency separately for each channel (i.e. amplitudes cannot be compared between channels). Without this option set, values in each channel group (scalp, source, MEG, Pgr, ICR) are scaled to the channel in this group that has the largest amplitude in its dominant frequency (i.e. amplitude relationships among channels within one channel group are upheld).&lt;br /&gt;
* Amplitude or power values can be displayed on a &amp;lt;u&amp;gt;'''L&amp;lt;/u&amp;gt;ogarithmic scale''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+V L'''&amp;lt;/span&amp;gt;). Amplitude values are displayed over two log units, power values over four log units. Thus, for amplitudes, values less than 1/100 (two log units) of the maximum are set to zero. For power, values less than 1/10000 (4 log units) of the maximum are set to zero.&lt;br /&gt;
* The sum of '''a&amp;lt;u&amp;gt;m&amp;lt;/u&amp;gt;plitudes''' or '''p&amp;lt;u&amp;gt;o&amp;lt;/u&amp;gt;wers''' in each frequency band can be displayed (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+V M'''&amp;lt;/span&amp;gt;, or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+V'''&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''O'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Spectra are shown as a curve of amplitude/power vs. frequency. If &amp;lt;u&amp;gt;'''C&amp;lt;/u&amp;gt;olor coding''' is selected (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+V C'''&amp;lt;/span&amp;gt;), then the areas underneath the curve are colored differently for each frequency band. Colors can be changed in the FFT Options menu (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''FFT/FFT Options Menu'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
* The frequency scale can be set to one of the three predefined display frequencies '''1-&amp;lt;u&amp;gt;3&amp;lt;/u&amp;gt;0 Hz, 1-&amp;lt;u&amp;gt;5&amp;lt;/u&amp;gt;0''' '''Hz''', (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+V 3'''&amp;lt;/span&amp;gt;, or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+V 5'''&amp;lt;/span&amp;gt;) '''or 1-half of the sampling frequency''', e.g. 1-100 Hz in the above screenshot of the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View'''&amp;lt;/span&amp;gt; menu. Alternatively, any user-defined '''Frequency &amp;lt;u&amp;gt;B&amp;lt;/u&amp;gt;and '''(&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+V B'''&amp;lt;/span&amp;gt;) can be displayed. The upper and lower boundary of the frequency band is set to the next whole-numbered multiple of the frequency resolution. The DC component is always set to zero.&lt;br /&gt;
* '''Info-box'''. Click with the right mouse button on a particular frequency in the spectrum of one of the channels to obtain a box with the following information: Channel name, frequency, and amplitude/power at that frequency.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The number of channels shown in the FFT display is the same as the number shown in the EEG display. If you change the EEG display (e.g. by changing the number of scalp electrodes or switching off polygraphic channels), the FFT display is updated automatically. The update can be performed without recalculation. If additional channels or artifact channels reconstructed by BESA Research artifact correction are switched on/off, or the status of bad or interpolated channels changes, the FFT is recalculated. Recalculation is only possible if the FFT was calculated over a block or the whole screen. The mean FFT window has to be closed in this case. Recalculation is also not possible if the FFT was loaded from a file. If you change the montage in the EEG display, the FFT window will always be removed: different montages require recalculation of the FFT.&lt;br /&gt;
&lt;br /&gt;
'''Note''': Bad channels in the original montage are displayed in an attenuated color. The spectrum of bad channels is zero for each frequency. As the dominant frequency, its amplitude and the sum of amplitudes or powers in each frequency band cannot be determined, a horizontal bar is shown for each missing value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notes about display resolution: frequencies and pixels'''&lt;br /&gt;
&lt;br /&gt;
When plotting the results of the FFT on the screen, there is a subtle interaction with the screen resolution which can affect the frequency and amplitude/power values displayed when generating maps or looking in the Info-box. Note that two types of situations can arise, depending on whether the number of frequency steps (= half the no. of sampling points in the data window) is greater or less than the number of screen pixels.&lt;br /&gt;
&lt;br /&gt;
If the number of frequency steps is less than or equal to the number of screen pixels, the amplitude at each frequency can be displayed correctly.&lt;br /&gt;
&lt;br /&gt;
If the number of frequency steps is greater than the number of screen pixels, then there are not enough pixels to display each amplitude. In this case, the amplitude displayed at each pixel is the maximum amplitude in the range of frequencies covered by that pixel. For a given pixel, this '''maximum''' amplitude can differ among channels. Thus, depending on the channel to which the mouse is pointing, the frequency displayed in maps (left click) or in the Info-box (right-click) can vary, even if the horizontal position of the mouse is the same.&lt;br /&gt;
&lt;br /&gt;
=== FFT 'File' Menu: Saving, Loading and Printing Results of the FFT ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Spectral (8).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Loading and Saving FFT'''&lt;br /&gt;
&lt;br /&gt;
Select '''Load...''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F L'''&amp;lt;/span&amp;gt;) to load an FFT file that has been saved to a binary file using '''Save...''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F S'''&amp;lt;/span&amp;gt;). An FFT spectrum should be redisplayed with the file from which it was calculated. An FFT file cannot be loaded if electrode configuration and bad channels of the current file do not match with the electrode configuration and bad channels of the saved FFT spectrum. The montage of the current EEG is changed to the montage of the loaded FFT. Filter settings that were active at the time when the FFT was calculated are not reset but are indicated correctly in the FFT printout.&lt;br /&gt;
&lt;br /&gt;
The heading of the printout shows the name of the loaded FFT file and the name of the EEG for which the FFT was calculated. If the loaded file contains a mean FFT spectrum, the mean FFT options are adjusted to the settings used to calculate the loaded mean FFT spectrum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Averaging FFT spectra'''&lt;br /&gt;
&lt;br /&gt;
Select '''Load and Average...''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F V'''&amp;lt;/span&amp;gt;) to compute averages of previously saved FFT spectra. In the appearing window, select an FFT spectrum (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''*.fft'''&amp;lt;/span&amp;gt;) from the list on the left and press the arrow button (--&amp;gt;) to copy it to the list of FFTs to be averaged on the right. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to calculate and display the averaged FFT spectrum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (2).png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Averaging of FFT spectra is only possible if the spectra were computed using the same epoch length (marked block or whole screen), montage, and sampling rate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Exporting FFT spectral data'''&lt;br /&gt;
&lt;br /&gt;
Select '''Export FFT Data''' in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; menu (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F&amp;amp;nbsp;F'''&amp;lt;/span&amp;gt;). You can select two different output montages:&lt;br /&gt;
&lt;br /&gt;
* Output '''81 &amp;lt;u&amp;gt;I&amp;lt;/u&amp;gt;nterpolated''' average referenced data (to a standard configuration of 81 electrodes, only available for EEG data) (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F FI'''&amp;lt;/span&amp;gt;), or&lt;br /&gt;
* Output '''Current &amp;lt;u&amp;gt;M&amp;lt;/u&amp;gt;ontage''' data (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F FM'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Select one of two output formats:&lt;br /&gt;
&lt;br /&gt;
* Write the data in''' Vectorized '''format:&lt;br /&gt;
** Line 1 of the output file contains the number of frequency steps (Npts), a starting value for BESA Research’s time scale (TSB), the frequency step (DI), scaling in bins per microvolt (SB), a scaling value for the BESA Research display (SC), and the number of channels (Nchan) as shown in the following example:&lt;br /&gt;
*** &amp;lt;tt&amp;gt;Npts= 1023 TSB= 0.10 DI= 0.100 SB= 1.000 SC= 100.0 Nchan= 23&amp;lt;/tt&amp;gt;&lt;br /&gt;
** Line 2 lists the channel labels.&lt;br /&gt;
** Each successive line contains the amplitude/power values at each frequency for one channel.&lt;br /&gt;
&lt;br /&gt;
* Write the data in '''&amp;lt;u&amp;gt;M&amp;lt;/u&amp;gt;ultiplexed''' format:&lt;br /&gt;
** Line 1 contains the frequency step size in Hz.&lt;br /&gt;
** Line 2 lists the channel labels.&lt;br /&gt;
** Each subsequent line contains amplitude/power values for all channels (in the sequence given in line 2) for one frequency.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Both vectorized and multiplexed files may be reread into BESA Research in the same way as time-domain averages. Vectorized files may be read directly using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File / Open'''&amp;lt;/span&amp;gt; menu. Multiplexed files may be read using the ASCII import menu item &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File / Import ASCII file'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each of these output formats and montages, different data can be saved:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;u&amp;gt;A&amp;lt;/u&amp;gt;mplitude Spectrum''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F FA'''&amp;lt;/span&amp;gt;),&lt;br /&gt;
* '''&amp;lt;u&amp;gt;P&amp;lt;/u&amp;gt;ower Spectrum''' &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''(Alt+F FP'''&amp;lt;/span&amp;gt;), or&lt;br /&gt;
* '''&amp;lt;u&amp;gt;R&amp;lt;/u&amp;gt;eal + Imaginary Part''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F FR'''&amp;lt;/span&amp;gt;). In this case, amplitudes of the real and imaginary components are written to two separate files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
File name extensions for each type of output file are given in the following table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Image:Spectral (11).gif]] --&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! current montage&lt;br /&gt;
! average reference&lt;br /&gt;
! mean in bands&lt;br /&gt;
|-&lt;br /&gt;
| amplitude spectrum&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | *.fma&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | *.faa&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | *.fba&lt;br /&gt;
|-&lt;br /&gt;
| power spectrum&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | *.fmp&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | *.fap&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | *.fbp&lt;br /&gt;
|-&lt;br /&gt;
| real components&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | *.fmr&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | *.far&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | N/A&lt;br /&gt;
|-&lt;br /&gt;
| imaginary components&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | *.fmi&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | *.fai&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Exporting band amplitudes and power'''&lt;br /&gt;
&lt;br /&gt;
Select '''Export &amp;lt;u&amp;gt;P&amp;lt;/u&amp;gt;ower in Bands''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F P'''&amp;lt;/span&amp;gt;) or '''Export &amp;lt;u&amp;gt;A&amp;lt;/u&amp;gt;mplitude in Bands''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F&amp;amp;nbsp;A'''&amp;lt;/span&amp;gt;). An ASCII file is produced with one channel per line, and each line contains the value for each frequency band.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sending FFT data to MATLAB'''&lt;br /&gt;
&lt;br /&gt;
Select''' Send to MATLAB '''(&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F M'''&amp;lt;/span&amp;gt;) to transfer the current FFT data to MATLAB. This menu entry is available only when MATLAB is installed. Details on the MATLAB interface are provided in the chapter [[MATLAB_Interface | MATLAB Interface]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (12).gif]]&lt;br /&gt;
&lt;br /&gt;
A dialog window opens that allows to specify:&lt;br /&gt;
&lt;br /&gt;
* the type of data to be transferred (Amplitude, Power, or Complex FFT data)&lt;br /&gt;
* whether each frequency bin should be transferred or frequencies should be pooled in bands&lt;br /&gt;
* the montage for which the FFT should be sent&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When hitting &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;, the sent data will be made available in MATLAB in struct variable &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''besa_fft'''&amp;lt;/span&amp;gt;. For details on the data transfer from BESA Research to MATLAB, please refer to the chapter [[MATLAB_Interface | MATLAB Interface]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Printing results of the FFT'''&lt;br /&gt;
&lt;br /&gt;
Select &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File / Print'''&amp;lt;/span&amp;gt; to print the FFT display and FFT maps. BESA Research uses the standard WINDOWS printer output. You may change your printer settings temporarily for your current BESA Research session. In the printer setup, you can choose the orientation (landscape or portrait) and the resolution. If you have any problems with printing, try to set the resolution to 300*300. If you want to change the printer setup permanently, please select the Printer Control from the WINDOWS main control group.&lt;br /&gt;
&lt;br /&gt;
A preview of the printout can be generated with &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File / Print Preview'''&amp;lt;/span&amp;gt;. Click on the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''OK''''&amp;lt;/span&amp;gt; button to return to the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Closing FFT'''&lt;br /&gt;
&lt;br /&gt;
To remove the FFT window (without saving the results), select ''Close'' in the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' File'''&amp;lt;/span&amp;gt; menu (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+F C'''&amp;lt;/span&amp;gt;), or simply type the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt; key.&lt;br /&gt;
&lt;br /&gt;
=== FFT ‘Options’ Menu ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options'''&amp;lt;/span&amp;gt; menu allows to define FFT mapping options, to set colors for the display of each frequency band, and to define and name up to 7 bands. When working with BESA Research, the band colors, names, and frequency ranges of the last session are stored in the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BESA.set'''&amp;lt;/span&amp;gt;. These values are then used in the next BESA Research session.&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (13).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Mapping options'''&lt;br /&gt;
&lt;br /&gt;
In the Mapping submenu two entries toggle different mapping modes:&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (14).gif]]&lt;br /&gt;
&lt;br /&gt;
* The entry '''3D Whole Head Mapping''' toggles between 3D and 2D mapping.&lt;br /&gt;
* The entry '''Top Meridian Projection''' toggles between top meridian projection and whole head mapping.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Defining band colors'''&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (15).gif]]&lt;br /&gt;
&lt;br /&gt;
Select &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options / Band Color'''&amp;lt;/span&amp;gt; (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+O C'''&amp;lt;/span&amp;gt;), and then the name of the band to define (e.g. &amp;lt;u&amp;gt;'''T&amp;lt;/u&amp;gt;heta''': &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+O CT'''&amp;lt;/span&amp;gt;). A window is presented with a palette of colors, allowing the choice of a color for the display.&lt;br /&gt;
&lt;br /&gt;
Select''' &amp;lt;u&amp;gt;D&amp;lt;/u&amp;gt;efault &amp;lt;u&amp;gt;C&amp;lt;/u&amp;gt;olors''' (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+O CD'''&amp;lt;/span&amp;gt;) to select the default colors for the bands (predefined in &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BESA.ini'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Defining band names and widths'''&lt;br /&gt;
&lt;br /&gt;
Select '''Options / Band Name and Width''' to define up to 7 band names and frequency ranges. A window showing names and frequency limits is displayed, allowing redefinition of the frequency bands. Overlapping frequency ranges can be defined. Upper/lower limits of FFT bands can be set up to the maximum frequency that can be displayed in the current FFT (which is usually half of the sampling rate). Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Default'''&amp;lt;/span&amp;gt; button to select the default definitions as predefined in the file BESA.ini and shown in the following table:&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (16).gif]]&lt;br /&gt;
&lt;br /&gt;
=== FFT Mouse Controls ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Single left click'''&lt;br /&gt;
&lt;br /&gt;
* on the '''displayed peak frequency''' or peak amplitude values of a channel or on the channel labels or head symbols at the left of the FFT window: Sets a cursor at the peak (dominant) frequency of the selected channel and displays a map of the topography at the marked frequency (only if the channel is not defined as bad).&lt;br /&gt;
* on the string indicating the '''spectrum type '''(Amp. Spectrum or Power Spectrum): Toggles between the display of amplitude and power spectrum.&lt;br /&gt;
* on the string indicating the map type (EEG or MEG): Toggles between EEG and MEG FFT maps (only for combined MEG and EEG measurements).&amp;amp;nbsp;&lt;br /&gt;
* on the '''displayed spectrum''': Sets a cursor and draws a FFT map of the topography at the marked frequency. The availability of this function by single left mouse click depends on the settings in the main window’s &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options / Mapping'''&amp;lt;/span&amp;gt; submenu (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options / Mapping / Enable Direct Mapping by Single Click'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The mouse pointer changes to a hand in areas of the FFT window where left mouse clicks initiate an action.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Double left click'''&lt;br /&gt;
&lt;br /&gt;
* on the '''displayed spectrum''': Sets a cursor and draws a map of the topography at the marked frequency. The availability of this function by single left mouse click depends on the settings in the main window’s &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options / Mapping'''&amp;lt;/span&amp;gt; submenu (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options / Mapping / Enable Direct Mapping by Double Click'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Right click'''&lt;br /&gt;
&lt;br /&gt;
* on the '''displayed spectrum''': Opens an info-box indicating channel name, frequency, and amplitude/power at that frequency.&lt;br /&gt;
&lt;br /&gt;
== Density Spectral Arrays (DSA) ==&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
The Density Spectral Arrays (DSA) module displays a compressed two-dimensional time-frequency display of the activity in the data file. It focuses on the frequency range of 1 Hz - 25 Hz which includes the commonly observed oscillatory rhythms in the human brain. This allows for a quick overview of the sections where events of interest occur, e.g. in the analysis of epileptic seizures or in sleep research. DSA values are computed for every second in the data file using a windowed FFT with a window length of 2s. By default, the DSA module uses a standardized brain source montage to separate the activities of both hemispheres and the different brain regions using 15 regional sources. This spatial filtering prior to the application of the time-frequency transformation helps to identify brain regions where oscillatory activity originates. The DSA can be invoked by hitting the [[Image:Spectral (17).gif]] button or from the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process'''&amp;lt;/span&amp;gt; menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (18).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (19).gif]]&lt;br /&gt;
&lt;br /&gt;
''Standard DSA display of an EEG containing four seizures. For each brain hemisphere, the sum of activities is shown.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Using DSA to navigate'''&lt;br /&gt;
&lt;br /&gt;
With a '''left mouse click''' into the DSA display, you can navigate to the selected EEG event. The data review window display jumps to the selected time in the record.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''DSA display modes'''&lt;br /&gt;
&lt;br /&gt;
Three modes of DSA display are possible:&lt;br /&gt;
&lt;br /&gt;
# Hemispheric Comparison, which sums up all the lateral activities of each hemisphere&lt;br /&gt;
# Regional Comparison, which gives account of the activity within five gross brain regions&lt;br /&gt;
# Current Montage, which shows the activity in each channel of the selected montage at the time the DSA window was opened. For MEG data, only the Current Montage option is available.&lt;br /&gt;
&lt;br /&gt;
For the first two modes, the signals are first transformed to the standardized brain source montage ''[[BESA_Research_Montage_Editor#Standard_Source_Montage_-_BR_Brain_Regions|BR_Brain Regions]]'' (see chapter '''[[Review#Remontaging|Review / Remontaging]]''') before the summation of the spectral parameters is performed. This transformation of the data to a source montage optimally separates the activities from the different brain regions that generate overlapping signals at the scalp surface. DSA of scalp channels can be seen by selecting a recording (traditional) montage and selecting mode 3, current montage.&lt;br /&gt;
&lt;br /&gt;
The way in which signals are sub-sampled to obtain the density display can be modified, from the fastest sub-sampling to an averaged or maximum signal display. The color-coded display of the spectral values in frequency bins can be normalized to the percentage value relative to the sum over all frequency bins of each channel.&lt;br /&gt;
&lt;br /&gt;
The current position in the data file is indicated by the vertical dashed lines in the display.&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (20).gif]]&lt;br /&gt;
&lt;br /&gt;
The time scale shows minutes as small grey ticks (in real-time - not time measured from file start). In the &amp;quot;''Hemispheric Comparison''&amp;quot; mode, the time scale appears in the middle, whereas it is displayed below the channels otherwise. Thicker gray ticks indicate five-minute marks, larger black ticks ten-minute-marks, and segment borders are displayed in red.&lt;br /&gt;
&lt;br /&gt;
=== Setting the DSA Display Mode ===&lt;br /&gt;
&lt;br /&gt;
The data can be remontaged for display in three different ways using the first three toolbar buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (21).gif]] '''Hemispheric Comparison (default option)'''&lt;br /&gt;
&lt;br /&gt;
Hemispheric comparison is activated by clicking on the '''leftmost''' toolbar button. The integrated activity of each hemisphere is shown. In this mode, the DSA window aligns with the event bar at the bottom of the main window to relate activity to the events marked in the event bar. The integrated activity of each hemisphere is calculated by first transforming the data to the standardized source montage ''BR_Brain'' ''Regions'', which is also available from the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Src'''&amp;lt;/span&amp;gt;&amp;quot; button in the BESA Research main window (see chapter ''&amp;quot;Review / Remontaging&amp;quot;).'' Then the signals of all source channels in the left ('''L''') and the right ('''R''') hemispheres are summed up separately. This transformation of the data to a source montage optimally separates the activities from the different brain regions that are overlapped and smeared at the scalp surface.&lt;br /&gt;
&lt;br /&gt;
For MEG data, this option is not available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (22).gif]]''' Regional Comparison &amp;amp;nbsp;'''&lt;br /&gt;
&lt;br /&gt;
This option is activated by clicking on the''' second''' toolbar button. The integrated activity of five brain regions is shown. The regions are:&lt;br /&gt;
&lt;br /&gt;
* '''FcpL, FcpR''', which sum all lateralized activity in the upper parts of the brain&lt;br /&gt;
* '''TmpL, TmpR''', which sum all activity in the temporal regions of the brain&lt;br /&gt;
* '''SagM''', which sum all activity in the sagittal midline regions of the brain (only shown if tick mark ''&amp;quot;Midline Channels&amp;quot;'' is on in &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Montage Options'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
In this mode, the DSA window is displayed in the right portion of the BESA Research main window. The integrated activity of each region is calculated by first transforming the data to the standardized source montage ''BR_Brain Regions'', which is also available from the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''&amp;quot;Src&amp;quot; '''&amp;lt;/span&amp;gt;button in the BESA Research main window (see chapter ''&amp;quot;Review / Remontaging''&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Then the signals of the source channels which belong to the corresponding region are summed up.&lt;br /&gt;
&lt;br /&gt;
For MEG data, this option is not available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (23).gif]] '''Current Montage'''&lt;br /&gt;
&lt;br /&gt;
With the '''third''' toolbar button, the Current Montage option is selected to display the spectra of the channels of the montage that was selected when the DSA window was opened. In this mode, the DSA window is displayed in the right portion of the BESA Research main window. If the current montage is changed in the BESA Research main window, the DSA display remains unchanged -''' Ändern'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (24).gif]] '''Source Montage'''&lt;br /&gt;
&lt;br /&gt;
The four following buttons, which appear only in the hemispheric comparison window, allow for the selection of the montage underlying the display, based on the source montage ''BR_Brain Regions''. One of the buttons is always down, with '''BR''' as default.&lt;br /&gt;
&lt;br /&gt;
In the case of '''BR''' (''Brain Regions''), the averages of all left-hand and right-hand side channels of the montage ''BR_Brain Regions'' are shown in the upper and lower channel, respectively, as indicated by the labels''' L''' and '''R'''.&lt;br /&gt;
&lt;br /&gt;
For '''TL''' (''Temporal Lobe''), the averages of the most important channels of the source montage ''TR_Temporal Regions'' are calculated and displayed in the upper and lower channels labelled '''L''' and '''R'''. The channels in question are TAL and TPL for the left-hand side and TAR and TPR for the right-hand side.&lt;br /&gt;
&lt;br /&gt;
'''FP''' (''Frontoparietal'') is based on the source montage ''BR_Brain Regions'' and averages the source channels FL, CL, PL and FR, CR, PR, respectively, displaying them in channels '''L''' and '''R.'''&lt;br /&gt;
&lt;br /&gt;
'''SG''' (''Sagittal'') also uses the source montage ''BR_Brain Regions''. The mean of the frontal sagittal channels FpM, FM and CM is displayed in the upper channel F, the mean of the posterior sagittal channels CM, OpM and CM is shown in the lower channel '''P'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (25).gif]] '''Visualizing Differences'''&lt;br /&gt;
&lt;br /&gt;
Many features of interest are lateralized in the brain and show up clearly when hemispheric regions are compared directly. This is achieved using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delta'''&amp;lt;/span&amp;gt; toolbar button:&lt;br /&gt;
&lt;br /&gt;
This button enables subtraction of hemispherically homologue regions and is available for the standardized montage options &amp;quot;''Hemispheric Comparison&amp;quot;'' and &amp;quot;''Regional Comparison&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
'''Hemispheric Difference'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;The integrated activities of the hemispheres (calculated as in the ''Hemispheric Comparison'' option) are subtracted from one another. The differences between the activities are displayed. The channel '''L+''' shows signal at the frequencies and latencies where activity was higher in the left hemisphere. Frequencies and latencies where activity was higher in the right hemisphere show up in channel '''R+.'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Regional Difference'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;The integrated activity of four brain regions is calculated as in the ''Regional Comparison'' option excluding the midline sagittal region. Then the activities of homologous regions are subtracted from one another and this difference is displayed on the side where the activity is larger: Thus, the channel '''FcpL+''' only shows signal at frequencies and latencies where activity was higher in ''FcpL'' than in ''FcpR''. The signals in the other channels are calculated accordingly.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (26).gif]] '''Epochs'''&lt;br /&gt;
&lt;br /&gt;
The epoch buttons allow the choice of time interval for browsing through the data.''' '''Either the whole file (&amp;quot;''All&amp;quot;)'' or intervals of 15, 20 or 30 minutes, with one additional''' '''minute of overlap with the following window, are shown. The default is 20 minutes,''' '''which corresponds best to the length of the standard EEG. For continuous data files,''' '''interval start times are chosen in relation to the full hour (e.g. 18:00, 18:20 and''' '''18:40 for the 20-minute window). Only the first and last windows are positioned such''' '''as to start and end with file start and end, respectively.&lt;br /&gt;
&lt;br /&gt;
The default epoch is &amp;quot;All&amp;quot; for files shorter than 20 minutes and &amp;quot;20&amp;quot; for longer files. For files no longer than 15 minutes, all buttons are greyed (with &amp;quot;All&amp;quot; automatically selected). Otherwise, &amp;quot;All&amp;quot; and those buttons which allow paging are enabled.&lt;br /&gt;
&lt;br /&gt;
In the case of &amp;quot;All&amp;quot; and files of long duration, a progress bar may appear. Hitting &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Abort'''&amp;lt;/span&amp;gt;&amp;quot; will result in the display of those portions of the data that have already been calculated.&lt;br /&gt;
&lt;br /&gt;
The epoch buttons are grayed in the zoom mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (27).gif]] '''Paging'''&lt;br /&gt;
&lt;br /&gt;
Page backward / forward one interval of the currently selected length. The page buttons are enabled only if the position in the file, and the file length, allow to browse to an earlier / later interval.&lt;br /&gt;
&lt;br /&gt;
The page buttons are grayed in the zoom mode.&lt;br /&gt;
&lt;br /&gt;
=== Display Options ===&lt;br /&gt;
&lt;br /&gt;
To emphasize features of interest, the DSA display can be optimized to normalize and scale the spectral data in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (28).gif]] '''Percentage Button'''&lt;br /&gt;
&lt;br /&gt;
The status of the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''percentage'''&amp;lt;/span&amp;gt; button on the toolbar determines how the color-coded display of the intensity values in frequency bins is normalized. The options are:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Absolute Value''' (button is up):&lt;br /&gt;
&lt;br /&gt;
If this option is selected, the absolute amplitude or power intensity values are displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Percentage''' (default option, button is down)&lt;br /&gt;
&lt;br /&gt;
If this option is selected, the intensity value for each sampling time and frequency is normalized to the summed intensities over all frequency bins averaged over all channels for that sampling time. Thus, the displayed DSA amplitude/power for one frequency bin is its contribution (in %) to the overall activity at that sampling time.&lt;br /&gt;
&lt;br /&gt;
The effect when applying the percentage normalization to data is shown in the example below, where the hemispheric difference with and without percentage normalization is shown:&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (29).gif]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (30).gif]]&lt;br /&gt;
&lt;br /&gt;
''Hemispheric difference display without percentage normalization (top) and with percentage normalization (bottom). The decreasing 9 to 7-Hz seizure activity in the right hemisphere emerges better from the background with percentage normalization.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (31).gif]] '''Amplitude Button'''&lt;br /&gt;
&lt;br /&gt;
The amplitude button toggles between the display of amplitude and power. The default setting is on amplitude (button is pressed).&lt;br /&gt;
&lt;br /&gt;
If amplitude is selected, displayed intensities are in µV/Hz, fT/Hz, fT/(cmHz), or nAm/Hz.&lt;br /&gt;
&lt;br /&gt;
If power is selected, displayed intensities are in µV²/Hz, fT²/Hz, fT²/(cm²Hz), or nAm²/Hz.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (32).gif]] '''Original Data and Baseline Normalization'''&lt;br /&gt;
&lt;br /&gt;
By default, the original data are shown (button D down). If option B (baseline normalization) is chosen, amplitude/power for each sampling time and frequency and each remontaged channel is normalized by the sum over all sampling times for the given frequency.&lt;br /&gt;
&lt;br /&gt;
This can sometimes help to suppress or intermittent or continuous signals of constant frequency.&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (33).gif]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (34).gif]]&lt;br /&gt;
&lt;br /&gt;
''Hemispheric comparison display without (top) and with (bottom) additional baseline normalization, which enhances the contrast between seizures and background for this example.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (35).gif]] '''Setting the Display Sampling'''&lt;br /&gt;
&lt;br /&gt;
Since the data file features far more sampling times than pixels available for DSA display, a sub-sampling is required to compress data file sections into the pixels shown in the DSA. The method how this is achieved can be chosen with the sampling popup menu. Using the sampling button in the toolbar, the type of sampling of data for the display can be chosen.&lt;br /&gt;
&lt;br /&gt;
Three options are possible:&lt;br /&gt;
&lt;br /&gt;
* '''Sub-sample Epochs:'''&lt;br /&gt;
&lt;br /&gt;
For each displayed pixel, one sample second in the middle of the represented time interval is selected. For this sample second, the activities are displayed. This is the fastest way to obtain the DSA display. The principle is illustrated in the graphics. In this example, only every fourth sample is computed for the DSA display.&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (36).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Average Epochs''' (default option):&lt;br /&gt;
&lt;br /&gt;
For each displayed pixel, the average over all seconds which are summarized in that pixel is calculated for each frequency bin. In this way, it is ensured that sudden bursts of activity are not accidentally missed out. The principle is illustrated in the graphics.&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (37).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Select Maximum:'''&lt;br /&gt;
&lt;br /&gt;
For each displayed pixel, the maximum over all seconds which are summarized in that pixel is calculated for each frequency bin. This enhances the impact of sudden bursts of activity in the display. The principle is illustrated in the graphics.&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (38).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (39).gif]] '''Scaling Buttons'''&lt;br /&gt;
&lt;br /&gt;
The left button (+) scales intensities up, the right one (-) scales them down. Each time one of the buttons is pressed, scaling is increased/decreased by a factor of ³√2. This means that pressing the same button 3 times results in doubling / halving the normalization intensity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Zooming the Display'''&lt;br /&gt;
&lt;br /&gt;
You can use the left mouse button to drag a rectangle anywhere in the display. A popup menu containing the entries &amp;quot;Zoom In&amp;quot; and &amp;quot;Zoom Out&amp;quot; appears, from which you can choose to zoom into the selected area. In the zoom mode, the epoch and page buttons are up and grayed.&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (40).gif]] Zooming out can be done using the Zoom Out button, which is shown only if the display is zoomed. The display then returns to the former view. Otherwise, dragging another rectangle reopens the popup menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' for further details on Spectral Analysis (FFT and DSA) in BESA Research, please refer to the Help Chapter ‘''Spectral Analysis’''.&lt;br /&gt;
&lt;br /&gt;
=== Tutorial ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;This tutorial will introduce the main features of the DSA module. A detailed description of all features can be found in the reference section.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The tutorial uses a data file with four concatenated EEG segments of epileptic seizure data (by courtesy of Prof. J. Ebersole, U Chicago). We will learn how to identify events in the data file quickly using the DSA display and how to find epochs with prominent rhythmic activities that differ between hemispheres.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;1. Use the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File / Open'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; menu to browse to the folder &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Examples\Epilepsy\Seizures'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;. Select the data file &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;''''Seizure-Right-Temporal.foc''''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; and open it. The data are shown in the originally recorded montage. By default, a time constant of 0.3 sec (i.e. Low Filter: 0.53 Hz) is enabled (unless you changed the settings in your &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.ini'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; file).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;2. In the main window, press pushbutton '&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Src''''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; and select the source montage '&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''TR_Temporal Region'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;. This displays the left and right temporal lobe channels in the top 8 traces and reveals strongly lateralized right temporo-basal seizure activity. Press the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''high filter'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; pushbutton &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''HF'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; and select &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''35 Hz'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to reduce the EMG artifact.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;3. Press the push button &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''DSA&amp;quot;'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; at the top of the main window. The DSA window opens. In the DSA display, the horizontal axis represents time, whereas the vertical axis represents frequency (from 1 to 25 Hz). &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;With the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Amplitude button'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (31).gif]]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; down, and the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Percentage button'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (28).gif]]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; released, the following image is obtained:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (41).gif]]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Four seizures can be distinguished in the display (red blocks of large EEG activity). Only two source channels, L and R, are shown, one for each hemisphere. These channels are obtained by calculating the mean left and right source activities using the 5 left and 5 right regional sources of brain source montage BR_BrainRegions to reduce overlap by volume conduction.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;4. '''Scale the DSA display'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; up using the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Scaling button'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; in the toolbar (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (42).gif]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;). Pressing it three times decreases the threshold for maximum intensity by a factor of 2. The color map caption text changes correspondingly. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Scale'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the display down again, either using the next toolbar button, or the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''Cursor-Down''''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key on the keyboard to set the amplitude scale to 79.4 nAm. This will reveal the dark 'nose-tips' at the beginning of the second and fourth seizure with frequencies decreasing from about 8 to 5 Hz and obvious lateralization to the right hemisphere.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;5. '''Move the mouse cursor'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; over the data display. Current time and frequency are shown below the color bar and next to the mouse cursor, respectively. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Click'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; on the red-nose tip (~6.5 Hz) around +00:02:09 (12:02:09 AM) in the right source channel (R) to move the EEG display to this epoch at the beginning of the second seizure. A comparison of the traces of the left (traces 1-4) and right (traces 5-8) temporal lobe sources (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Src/TR_Temporal Region''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;) confirms the lateralization of the seizure onset to the right hemisphere.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (43).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;6. '''Press'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''second-left'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; toolbar button (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (44).gif]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;) to switch to the display mode &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''''Regional Comparison''''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;. The DSA display moves to the right of the main window and displays the spectral densities of five regions by summarizing the activities in the lateralized upper parts of the brain, in the temporal regions bilaterally, and in the midline regions.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (45).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;7. '''Press'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''third'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; toolbar button (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (46).gif]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;) to switch to the display mode &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''''Current Montage'. '''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The DSA display on the right of the main window now displays the spectral densities of all channels in the current montage. Enlarge the DSA window by using the full-screen symbol at the top right. It is very apparent now that the seizures start with an interval of increased activity in the 8-5 Hz range. This activity is most noticeable in the anterior three source channels of the right temporal lobe (TBvr_TR, TApr_TR, and TArR_TR). &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (47).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;8. Use the overlapping window icon at the top right of the window to get the window back to its original position at the right of the screen. Then press the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Sampling '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;toolbar button ( &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (48).gif]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; ) to select the menu entry &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''Select Maximum''''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; from the dropdown menu which appears. This results in pronouncing maxima of intensities: for each frequency bin, the maximum over the epoch that is related to one pixel of the display is computed. In this case, the noise is enhanced by the procedure. Press the button again to go back to 'Average Epochs', which displays the average over the epoch related to one displayed pixel for each frequency bin.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;9. '''Close the DSA window'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; using the close symbol at the top right. Press pushbutton &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''Vir''''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to select the virtual &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Horizontal Bipolar'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; montage. Press the pushbutton &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''DSA'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to recalculate DSA for the new current montage, then press the Amplitude button ( &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (31).gif]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; ) and the third toolbar button (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (23).gif]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;). You can now see that the scalp montage, although optimized for temporal-basal activity shows a poor separation between hemispheres.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (49).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;10. '''Press'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''second-left'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; toolbar button ( &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (44).gif]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; ) to select the menu entry &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''Regional Comparison''''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Press'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''Delta''''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button ( &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (25).gif]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; ) to switch to regional difference. The channels now show the difference between activities in the homologous brain regions. Then &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''press'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Display '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (50).gif]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;) to switch to the display mode&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''' 'Percentage''''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;. Now, the relative spectral amplitude in each frequency bin and time point is displayed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''' Switch'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to displaying &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''spectral power'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; by releasing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Power'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button ( &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Spectral (31).gif]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; ). Adjust the scaling to 16% at maximum intensity using the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''scaling'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; toolbar buttons or the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''cursor up-down'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; keys.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (51).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;This display mode takes away most of the unwanted activity which is not lateralized, and clearly shows the dark clusters in the right hemisphere in the 7 Hz range immediately before the second and fourth seizure.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;11. Use the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''left mouse button'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to drag a rectangle around the beginning of the fourth seizure in channel &amp;quot;TmpR+&amp;quot;. From the popup menu that appears, select &amp;quot;Zoom In&amp;quot;. The display is zoomed to show just the selected area. The seizure onset of the 4th seizure is visible as a decelerating 7Hz oscillation in the right temporal region. Use the right mouse button to zoom out again.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Spectral (52).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This concludes the tutorial on density spectral arrays. It gave a brief introduction into the ways in which the DSA can be used in combination with traditional and brain source montages, and demonstrated its abilities to quickly identify epochs and regions of interest in EEG data files.&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Montage_Editor</id>
		<title>BESA Research Montage Editor</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Montage_Editor"/>
				<updated>2021-06-01T10:12:33Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Montage Editor - Introduction ==&lt;br /&gt;
&lt;br /&gt;
The Montage Editor provides information about the current montage and the available standard montages.&lt;br /&gt;
&lt;br /&gt;
The Montage Editor also offers the possibility to create new user-defined montages, modify a standard montage, or combine channels from different montages.&lt;br /&gt;
&lt;br /&gt;
Edited Montages can be saved and selected in the main window of the BESA Research program using the montage push buttons or the montage menu.&lt;br /&gt;
&lt;br /&gt;
The Montage Editor opens after clicking on the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' EdM'''&amp;lt;/span&amp;gt; push button in the BESA Research ''control ribbon.''&lt;br /&gt;
&lt;br /&gt;
The following chapters will guide you through the most important features and the layout of the Montage Editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Layout of the Montage Editor ==&lt;br /&gt;
&lt;br /&gt;
The Montage Editor window is subdivided into three main parts which will be explained briefly in the following sections.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (4).jpg|500px]] [[Image:Montage Editor (5).jpg|490px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''title bar''' shows the name of the ''current montage'' (the montage which is currently displayed).&lt;br /&gt;
&lt;br /&gt;
Most of the functions and commands can be chosen from the main &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''menu bar'''&amp;lt;/span&amp;gt; and the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''toolbar'''&amp;lt;/span&amp;gt; below the title bar. However, many commands are also available via a right mouse click. If you right-click, a context-sensitive popup menu may appear containing the available commands. &lt;br /&gt;
&lt;br /&gt;
The functions of the toolbar and the popup menus are described in the next section. A detailed description of the commands of the menu bar is given in electronic help chapter ''&amp;quot;Montage Editor / Reference&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
=== 2D View ===&lt;br /&gt;
&lt;br /&gt;
The 2D view displays a scheme of the ''current montage''. Additionally, available electrodes which are not used in the current montage can be shown.&lt;br /&gt;
&lt;br /&gt;
The name of the current montage is given at the top. Note: If the montage name starts with '''&amp;quot;Add:&amp;quot;''', an ''additional channel montage'' is displayed. Additional channel montages are described in the chapter ''&amp;quot;Predefined Additional Channel Montages&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (1).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (2).png]] Use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''One 2D Head toolbar button'''&amp;lt;/span&amp;gt; if you want to switch between the available 2D head views: the top meridian projection, or the top, bottom, back, front, left and right views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (1).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The top meridian projection shows all electrodes of the current montage. Other 2D head views only show the electrodes which are visible from the corresponding side.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (4).png]] Use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Four 2D Heads toolbar button'''&amp;lt;/span&amp;gt; to switch between the available four head layouts.&lt;br /&gt;
&lt;br /&gt;
The following objects are displayed:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (5).png]] '''Recorded electrodes''' which are available for the current data file, not interpolated and not marked as 'bad'.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (6).png]] '''Interpolated electrodes''' which have been set as 'to be interpolated' in the main program.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (7).png]] '''Bad electrodes''' or '''bad MEG sensors''' which have been marked as 'bad' in the main program.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (8).png]] '''Virtual electrodes''' at predefined locations. The interpolated 81 electrodes are always available for EEG data files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (9).png]] '''MEG sensors''' which are available for the current data file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (11).png]][[Image:Montage Editor (12).png]][[Image:Montage Editor (10).png]] '''Montage channels''' with the underlying recorded/virtual electrode or MEG sensor as primary channel and no reference channel or a reference channel which is not visible for the current 2D head view or which is no single channel reference – may be a reference calculated by several channels, e.g.'' avr''&amp;lt;span style=&amp;quot;color:#000080;&amp;quot;&amp;gt; or&amp;lt;/span&amp;gt; ''ears''. If a montage channel is selected, the inner circle becomes darker.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (14).png]][[Image:Montage Editor (13).png]]'''Montage channels''' with underlying recorded/virtual electrode as primary channel (left electrode) and the right electrode as reference, connected with the montage channel line. If a montage channel is selected, the blue/red circle and the montage channel line become darker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional objects are visible if the 'Edit' montage is displayed. The chapter &amp;quot;Montage Editor / Editing a Montage / Editing in the 2D View and Icr/Pgr View&amp;quot; gives a description of these objects and explains how the 'Edit' montage can be modified.&lt;br /&gt;
&lt;br /&gt;
A right mouse click on a montage channel in the 2D view opens a context-sensitive popup menu for fast access to the most important commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Montage Channel List ===&lt;br /&gt;
&lt;br /&gt;
The montage channel list is displayed to the right of the '''2D View'''. It displays all montage channels of the ''current montage''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (15).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A montage channel consists of a (primary) channel and may be a reference channel against which the primary channel data are calculated. In the example shown above (which really does not make much sense but shows most of the available channel types) the recorded electrode&amp;lt;span style=&amp;quot;color:#5b9bd5;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#0070c0;&amp;quot;&amp;gt;Pz&amp;lt;/span&amp;gt; and the virtual electrode &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Cz&amp;lt;/span&amp;gt; are used as references.&lt;br /&gt;
&lt;br /&gt;
Distinctions are made between channel and reference types and states as follows:&lt;br /&gt;
&lt;br /&gt;
*'''Recorded electrodes''': Recorded electrodes which are available for the current data file are displayed in &amp;lt;span style=&amp;quot;color:#0070c0;&amp;quot;&amp;gt;blue&amp;lt;/span&amp;gt;. They may be used as primary and reference channels.&lt;br /&gt;
&lt;br /&gt;
*'''Recorded references''': A combined reference based on the recorded electrodes, e.g.&amp;lt;span style=&amp;quot;color:#0070c0;&amp;quot;&amp;gt; avr&amp;lt;/span&amp;gt;. They are also displayed in &amp;lt;span style=&amp;quot;color:#0070c0;&amp;quot;&amp;gt;blue.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Interpolated electrodes''': Interpolated electrodes are recorded electrodes that have been set as 'to be interpolated' in the main program. They are displayed in &amp;lt;span style=&amp;quot;color:#9966ff;&amp;quot;&amp;gt;light purple&amp;lt;/span&amp;gt;. Interpolated electrodes may be used as primary and reference channels.&lt;br /&gt;
&lt;br /&gt;
*'''Bad channels''': Recorded channels which have been marked as 'bad' for the current data file are displayed in&amp;lt;span style=&amp;quot;color:#808080;&amp;quot;&amp;gt; gray&amp;lt;/span&amp;gt;. You may use them as primary or reference channels, but the corresponding data waveform will not be displayed in the main program. However, if you switch to a new data file and the channel is no longer marked as 'bad', the corresponding data waveform will be displayed.&lt;br /&gt;
&lt;br /&gt;
*'''Unavailable channels''': Channels which are not available for the current data file are also displayed in &amp;lt;span style=&amp;quot;color:#808080;&amp;quot;&amp;gt;gray&amp;lt;/span&amp;gt; and the suffix “[NA]” is appended. You may use them as primary or reference channels but the corresponding data waveform will not be displayed in the main program. However, if you switch to a new data file and the channel becomes available, the corresponding data waveform will be displayed.&lt;br /&gt;
&lt;br /&gt;
*'''Virtual electrodes''': Virtual electrodes at predefined locations. They are always available for any (EEG) data file, displayed in &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;red.&amp;lt;/span&amp;gt; They may be used as primary and as reference channels.&lt;br /&gt;
&lt;br /&gt;
*'''Virtual references''': A combined reference based on virtual electrodes, e.g. &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;ears&amp;lt;/span&amp;gt;. They are also displayed in &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;red.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Source montage channels''': Source montage channels consist of a single dipole or a regional source as primary channel and cannot have a reference. The source labels are displayed in &amp;lt;span style=&amp;quot;color:#00b050;&amp;quot;&amp;gt;green&amp;lt;/span&amp;gt;. The individual source color is given as a small colored bar to the left.&lt;br /&gt;
&lt;br /&gt;
*'''MEG channels''': Recorded MEG channels which are available for the current data file and which are not marked as 'bad' are displayed in &amp;lt;span style=&amp;quot;color:#401b5b;&amp;quot;&amp;gt;dark purple&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*'''Polygraphic channels''': Available polygraphic channels are written in '''black.'''&lt;br /&gt;
&lt;br /&gt;
*'''Intracranial electrodes''': Available intracranial electrodes are given in&amp;lt;span style=&amp;quot;color:#663300;&amp;quot;&amp;gt; brown&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*'''Selected montage channels''': Labels of selected montage channels are highlighted with a black background. A montage channel can be selected by a left mouse click on the channel label. Hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Control '''&amp;lt;/span&amp;gt;key to select more than one montage channel simultaneously.&lt;br /&gt;
&lt;br /&gt;
*'''Highlighted montage channel''': The highlighted montage channel is marked by a yellow rectangle around its label. A montage channel is highlighted if the mouse cursor moves slowly over its label or over the corresponding plot in the '''2D view'''. Only one montage channel can be highlighted at a time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A right mouse click somewhere in the montage channel list opens a context-sensitive &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''popup menu'''&amp;lt;/span&amp;gt; for fast access to the most important commands.&lt;br /&gt;
&lt;br /&gt;
The chapter &amp;quot;''Editing a Montage in the Montage Channel List&amp;quot;'' gives an explanation of how to modify the''' 'Edit' montage '''in the montage channel list.&lt;br /&gt;
&lt;br /&gt;
=== 3D View ===&lt;br /&gt;
&lt;br /&gt;
The 3D view is used to visualize the equivalent locations of source channels inside the head in the ''current montage'' and to display the recorded EEG channel montage on the 3D head surface.&lt;br /&gt;
&lt;br /&gt;
* If a source montage channel is selected, the 3D view is centred w.r.t. to the source location and the 3D source location is highlighted by a golden halo. If you click on a source in the 3D view, the corresponding montage channel will be selected.&lt;br /&gt;
* If scalp electrodes are part of the montage, the 3D whole-head view displays the corresponding electrodes on the head surface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (17).png]] [[Image:Montage Editor (16).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Editing is not possible in the 3D view. Use the''' 2D view '''or the '''montage channel list''' instead.&lt;br /&gt;
&lt;br /&gt;
=== Pgr/Icr View (Polygraphic / Intracranial Channels) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This view displays a scheme of the available polygraphic/intracranial Channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (18).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (19).png]] Use the Intracranial Channels button to switch on/off the display of intracranial channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (20).png]] Use the Polygraphic Channels button to switch on/off the display of polygraphic channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following objects are displayed:&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (21).png]] '''Intracranial electrodes''' (brown color) which are available for the current data file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (22).png]] '''Polygraphic channels''' (black color) which are available for the current data file.&lt;br /&gt;
&lt;br /&gt;
== Creating and Editing a Montage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Creating a New Montage ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (23).png]] &amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Press the&amp;lt;/span&amp;gt;''' New 'Edit' Montage '''&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;toolbar button. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (24).png]] &amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;This clears and opens the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Edit' montage''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; as indicated by the highlighted &amp;lt;/span&amp;gt; ''''Edit' Montage '''&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;toolbar button. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (25).png]] Then select the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Recorded Electrodes'''&amp;lt;/span&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (26).png]] &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Virtual Electrodes'''&amp;lt;/span&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (27).png]] &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''MEG Sensors'''&amp;lt;/span&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (20).png]] &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Polygraphic Channels'''&amp;lt;/span&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (19).png]] or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Intracranial Channels'''&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
toolbar buttons depending on which type of channels you want to add.&lt;br /&gt;
&lt;br /&gt;
You can add new montage channels now in three different ways:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Add new montage channels in the '''2D view''' and '''Pgr/Icr view''' by selecting channels and dragging to the reference electrode (T7 to P7 in the example below)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (28).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Click on the ''Set chan. &amp;amp; ref''. text box. This box will start flashing to indicate that new channels can be added. Click alternately on the next channel to be added (in the 2D view, the Pgr/Icr view, or the montage channel list), followed by its reference electrode. Each new click will alternately define a new montage channel and its reference. When done adding new channels, click on the ''Set chan. &amp;amp; ref.'' text box again,'' ''which will stop flashing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (29).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Select one or more channels (see “''Editing in the 2D View'' ''and Pgr/Icr View”'' and “''Editing in the Montage Channel List”'') and add them using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''right-click popup menu'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add '''source '''channels, switch to the desired source montage using the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Standard Source'''&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Montages'''&amp;lt;/span&amp;gt; toolbar button [[Image:Montage Editor (30).png]], select montage channels in the Montage Channel List (see ''“Editing in the Montage Channel List”''), and copy and paste to the 'Edit' Montage.&lt;br /&gt;
&lt;br /&gt;
For more details see the sections “''Editing in the 2D View and Pgr/Icr View”'' and ''“Editing in the Montage Channel List''” below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Editing a Montage ===&lt;br /&gt;
&lt;br /&gt;
In the Montage Editor, only one montage can be edited at a time. This is referred to as the ''''Edit' montage'''. The most convenient ways to edit recorded or virtual scalp montages are described below in the sections [[BESA_Research_Montage_Editor#Editing_a_Montage_in_the_2D_View_and_Pgr.2FIcr_View|Editing a Montage in the 2D View and Pgr/Icr View]] and [[BESA_Research_Montage_Editor#Editing_a_Montage_in_the_Montage_Channel_List|Editing a Montage in the Montage Channel List]]&lt;br /&gt;
&lt;br /&gt;
Whenever you want to modify a predefined standard montage, an available '''user montage''', or an '''additional channel montage''', you have to select the montage you want to modify and copy it to the 'Edit' montage. If you have not yet edited a montage after starting the montage editor, the 'Edit' montage is empty. &lt;br /&gt;
&lt;br /&gt;
When you switch from the selected current montage to the 'Edit' montage using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''Edit' Montage toolbar button'''&amp;lt;/span&amp;gt; [[Image:Montage Editor (31).png]], then the selected '''current montage''' is automatically copied to the 'Edit' montage. In addition, the Montage Editor copies the current montage to the 'Edit' montage automatically if you start dragging or deleting montage channels when viewing a selected montage.&lt;br /&gt;
&lt;br /&gt;
If the 'Edit' montage is not empty, you can clear it by clicking again on the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''Edit' Montage toolbar button'''&amp;lt;/span&amp;gt; or by clicking on the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''New 'Edit' Montage button'''&amp;lt;/span&amp;gt; [[Image:Montage Editor (23).png]] . Then switch&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' '''&amp;lt;/span&amp;gt;to the montage you want to modify using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Standard User'''&amp;lt;/span&amp;gt;, or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Additional Montage&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;buttons'''&amp;lt;/span&amp;gt; and switch back to the 'Edit' montage using the toolbar buttons. This copies&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' '''&amp;lt;/span&amp;gt;the selected montage to the 'Edit' montage.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Reference of Montage Channels ===&lt;br /&gt;
&lt;br /&gt;
In the ''''Edit' montage''', select one montage channel by clicking on the related electrode in the 2D View or select the channel from the montage channel list. Select more channels by holding down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Control key'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To change the reference of the selected channels, use the ''Set Reference ''text box in one of the following ways:&lt;br /&gt;
&lt;br /&gt;
* Either drag from the ''Set Reference'' text box to an electrode in the 2D view, to a channel box in the Pgr/Icr view, to any of the standard reference text boxes at the top of the 2D view (see also [[BESA_Research_Montage_Editor#Editing_a_Montage_in_the_2D_View_and_Pgr.2FIcr_View|Editing a Montage in the 2D View and Pgr/Icr View]]) or onto a montage channel in the montage channel list as shown below.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (32).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Or click on the ''Set Reference ''text box (it will start flashing), and then click on the desired reference channel in the Montage Channel List, in the 2D view, or in the Pgr/Icr view.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (33).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If you want to modify the viewing reference of the '''recorded Referential''' or the '''virtual Referential''' montage, you don’t have to edit a montage. To change the viewing reference in the referential montages simply switch to the corresponding montage and drag from the ''Set Reference ''box to the desired new reference electrode in the 2D view (as shown in the section after next).&lt;br /&gt;
&lt;br /&gt;
=== Creating New Average Channel Groups ===&lt;br /&gt;
&lt;br /&gt;
Average channel groups can be used as references in montage channels. They are computed for each time point as the mean voltage over the amplitudes of included channels. If one channel is bad or not available, average channel groups including this channel are also not available.&lt;br /&gt;
&lt;br /&gt;
For the creation of a new average channel group, at least two channels must be selected (see chapter [[BESA_Research_Montage_Editor#Editing_a_Montage_in_the_2D_View_and_Pgr.2FIcr_View|Editing a Montage in the 2D View and Pgr/Icr View]] for information about how channels are selected). Channels must be of the same type. Source channels and MEG sensors are not allowed in average channel groups.&lt;br /&gt;
&lt;br /&gt;
Channels that have been selected multiple times will enter the average only once.&lt;br /&gt;
&lt;br /&gt;
To create a new average channel group, activate the corresponding menu entry (see chapters “''Montage Channel List Popup Menu”'' and “''Edit Menu”'').&lt;br /&gt;
&lt;br /&gt;
Note that you can get information about average channel groups which are currently available using the ''Average Channel Group Information'' dialog box.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Viewing Reference in Referential Montages ===&lt;br /&gt;
&lt;br /&gt;
If the '''recorded Referential''' or the '''virtual Referential''' montage is displayed, an additional ''Set Reference'' text box is displayed in the '''2D view'''. In the example below, the viewing reference of the''' virtual Referential '''montage is changed from Cz to A2. The'' Set Reference ''box can be used to change the viewing reference in one of the following ways:&lt;br /&gt;
&lt;br /&gt;
* Place the mouse cursor on the ''Set Reference ''text box and press and hold the left mouse button. Start to move the mouse while the left mouse button is still held down (“dragging”). The mouse cursor changes to a black cross as soon as dragging has begun. Move the mouse cursor to one of the visible electrodes in the 2D view or to a montage channel in the montage channel list. If the cursor is on top of an electrode or montage channel which can be set as a viewing reference, the cross-color changes to green. Release the left mouse button while the cursor cross is green. A new viewing reference is set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (34).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Alternatively, click on the ''Set Reference'' text box. It will start blinking. Then click onto the new reference channel either in the Montage Channel List, in the 2D view, or in the Pgr/Icr view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (35).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Exit'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Set toolbar button'''&amp;lt;/span&amp;gt; [[Image:Montage Editor (36).png]] to return to the main window of the BESA Research program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Re-reference to Linked Mastoids ===&lt;br /&gt;
&lt;br /&gt;
In case the linked mastoids channels are classified as polygraphic, the following steps can be performed to create a linked mastoids reference montage.&lt;br /&gt;
# With the raw data set opened in BESA Research,  press '''File''' -&amp;gt; '''Head surface points and sensors''' -&amp;gt; '''Save all file in Head Coordinates'''&lt;br /&gt;
# Open the exported ''*.ela'' file in a text editor. You will see that all of your electrodes have the label ''EEG'' and the mastoids will have the label ''POL''.&lt;br /&gt;
## Change the label of the mastoids to ''EEG''.&lt;br /&gt;
## Rename the mastoids ''M1'' and ''M2''. The renaming will lead to BESA Research detecting the electrodes as mastoids and giving them standard mastoid positions. Save the file.&lt;br /&gt;
# Return to BESA Research and press ''Ctrl-L''. This will open the channel and digitized head surface points dialog. Under '''Channel configuration''' browse to the *.ela file that you have just created and load it. You should now see that the mastoids are not displayed in black any longer.&lt;br /&gt;
# Press '''Edit''' -&amp;gt; '''Montage'''. In the middle pane select both your mastoid electrodes M1 and M2 holding down the Ctrl key. Right-click and select '''Create new channel group'''. Rename it to '''Linked Mastoids'''. The new channel group should appear over the left head scheme. If not, press ''E'' on the keyboard. Now select all your channels, press '''Set reference''' (bottom left) and click on '''Linked mastoids'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Editing a Montage in the 2D View and Pgr/Icr View ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Reference Boxes'''&lt;br /&gt;
&lt;br /&gt;
If the ''''Edit' montage''' is displayed, additional reference boxes are displayed at top of the '''2D view''' showing available multiple channel references or average channel groups (see “''Create New Average Channel Group”''). If not all available reference boxes can be shown, an additional text box [[Image:Montage Editor (37).png]] &amp;amp;nbsp;is displayed. If the mouse cursor is positioned over this box, the remaining reference boxes will be displayed temporarily. Reference text boxes may be used to define references for new montage channels (see below).&lt;br /&gt;
&lt;br /&gt;
Additional references displayed in blue are recorded references. Additional references shown in red are virtual references. The recorded (virtual) '''ears''' reference, for example, is the mean voltage of the amplitudes at recorded (virtual) electrodes A1 and A2. The recorded (virtual)''' mast''' reference is the mean voltage of the amplitudes at recorded (virtual) mastoid electrodes M1 and M2. If the electrodes A1/A2 or M1/M2 are not present in the current electrode configuration, or if the electrode locations have been digitized (i.e. the electrodes are not exactly at the default position), a recorded '''ears''' or recorded''' mast''' reference may be available. This reference is built of the two recorded electrodes that are closest to the standard positions of A1/A2 or M1/M2 if they are within 12 degrees of these standard positions. Note that this assignment of the reference is independent of the actual electrode label in this case. The '''mast''' reference in the example below is calculated as the mean voltage of the amplitudes at P7 and P8, for example. A recorded ears reference is not available in this example as there are no recorded electrodes within 12 degrees of the standard positions of A1/A2.&lt;br /&gt;
&lt;br /&gt;
Note that you can right-click on a reference box of an average channel group to display the ''Average Channel Group Information'' dialog box showing detailed information about available average channel groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (38).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Selecting Montage Channels'''&lt;br /&gt;
&lt;br /&gt;
Montage channels can be selected by clicking on the montage channel line or the channel circle/box. If a montage channel is selected, other selected montage channels will be deselected unless you also hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Control key'''&amp;lt;/span&amp;gt;. With the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Control key'''&amp;lt;/span&amp;gt;, the new montage channel is added to the current selection.&lt;br /&gt;
&lt;br /&gt;
You may also drag a box with the left mouse button to select all channels within the rectangle box. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Control'''&amp;lt;/span&amp;gt; key when releasing the mouse button to add the channels to the current selection.&lt;br /&gt;
&lt;br /&gt;
All montage channels are deselected by clicking beneath any montage channel while the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Control key '''&amp;lt;/span&amp;gt;is not pressed, or by hitting the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Escape key.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (40).png]] [[Image:Montage Editor (39).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Deleting Montage Channels'''&lt;br /&gt;
&lt;br /&gt;
To delete montage channels, select them and activate the corresponding entry in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Edit menu'''&amp;lt;/span&amp;gt; or in the right-click &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''popup menu'''&amp;lt;/span&amp;gt;, or press the corresponding hot key (default: &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Note: If you want to clear the 'Edit' montage completely, use the corresponding entry in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''Edit' Montage popup menu'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Adding Montage Channels'''&lt;br /&gt;
&lt;br /&gt;
There are four ways of adding new montage channels:&lt;br /&gt;
&lt;br /&gt;
* If you previously copied or cut montage channels using the corresponding menu entry in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Edit menu'''&amp;lt;/span&amp;gt;, you can paste them using the same menu or using the associated hot key (default: &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Control-V'''&amp;lt;/span&amp;gt;). The montage channels are inserted before the first selected montage channel in the 'Edit' montage. If no montage channel is selected, they are appended at the end of the '''montage channel list'''.&lt;br /&gt;
* Drag from a visible electrode or polygraphic/intracranial channel to another visible electrode or polygraphic/intracranial channel, to one of the additional reference boxes plotted at the top of the 2D view, or to a montage channel in the montage channel list. If the mouse cross becomes green, release the mouse button. The new montage channel will be added at the end of the montage channel list. &lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Recorded Electrodes''' [[Image:Montage Editor (25).png]] &amp;lt;/span&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Virtual Electrodes''' [[Image:Montage Editor (26).png]] &amp;lt;/span&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''MEG Sensors''' [[Image:Montage Editor (27).png]] &amp;lt;/span&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Polygraphic Channels''' [[Image:Montage Editor (20).png]] &amp;lt;/span&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Intracranial Channels''' [[Image: Montage Editor (19).png]] &amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
toolbar buttons to display or hide the corresponding electrodes/channels.&lt;br /&gt;
You can hit the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Escape'''&amp;lt;/span&amp;gt; key while dragging if you want to abort the drag operation.&lt;br /&gt;
&lt;br /&gt;
* Click on the Set chan. &amp;amp; ref. text box. This box will start blinking to indicate that new channels can be added. Click alternatively on the next electrode/channel to be added (in the 2D view, The Pgr/Icr view, or the montage channel list), followed by its reference electrode (if required). Each new click will alternatively add a new montage channel and its reference. When done adding new channels, click again on the Set chan. &amp;amp; ref. text box, which will stop blinking.&lt;br /&gt;
* Select channels from the 2D view, the Pgr/Icr view, and the montage channel list and right-click on a selected channel to display a '''popup menu''', to add the selected channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting Montage Channels'''&lt;br /&gt;
&lt;br /&gt;
In the 2D view or the Pgr/Icr view, there is no way to modify the sequence of montage channels. Use the '''montage channel list''' instead as described in the section [[BESA_Research_Montage_Editor#Editing_a_Montage_in_the_Montage_Channel_List|Editing a Montage in the Montage Channel List]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changing the Reference'''&lt;br /&gt;
&lt;br /&gt;
Select the montage channel(s) for which you wish to change the reference. If no montage channel is selected, you can modify the reference for all montage channels simultaneously.&lt;br /&gt;
&lt;br /&gt;
Drag from the ''Set Reference'' text box at the bottom of the 2D view to another visible electrode/channel or to one of the additional reference boxes at top of the 2D view. Alternatively, click on the ''Set Reference'' text box (it will start blinking), and then click on the desired reference channel in the montage channel list, in the 2D view, or in the Pgr/Inc view.&lt;br /&gt;
&lt;br /&gt;
Note that you can hit the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Escape '''&amp;lt;/span&amp;gt;key if you want to abort the drag operation.&lt;br /&gt;
&lt;br /&gt;
=== Editing a Montage in the Montage Channel List ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the ''''Edit' montage''' is currently displayed, this montage may be modified in the '''montage channel list''' as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Selecting Montage Channels'''&lt;br /&gt;
&lt;br /&gt;
Montage channels can be selected by clicking on the primary channel label box or on the reference label box. If a montage channel is selected, other selected montage channels will be deselected unless you also hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Control'''&amp;lt;/span&amp;gt; key. With the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Control '''&amp;lt;/span&amp;gt;key pressed, the new montage channel is added to the current selection.&lt;br /&gt;
&lt;br /&gt;
All montage channels are deselected by clicking beneath any montage channel while the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Control'''&amp;lt;/span&amp;gt; key is not pressed, or by hitting the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Escape'''&amp;lt;/span&amp;gt; key.&lt;br /&gt;
&lt;br /&gt;
'''Deleting Montage Channels'''&lt;br /&gt;
&lt;br /&gt;
To delete montage channels, select them and activate the corresponding entry in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Edit menu'''&amp;lt;/span&amp;gt; or in the right click &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''popup menu'''&amp;lt;/span&amp;gt;, or press the corresponding hot key (default: &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Another possibility is to drag them over the left border of the montage channel list – the mouse cursor changes to a litter box icon.&lt;br /&gt;
&lt;br /&gt;
Note: If you want to clear the 'Edit' montage completely, use the corresponding entry in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''Edit' Montage popup menu'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Adding New Montage Channels'''&lt;br /&gt;
&lt;br /&gt;
There are two ways to add new montage channels:&lt;br /&gt;
&lt;br /&gt;
* If you previously copied or cut montage channels using the corresponding menu entry in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Edit menu'''&amp;lt;/span&amp;gt;, you can paste them using the same menu or using the associated hot key (default: &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Control-V).'''&amp;lt;/span&amp;gt; The montage channels are inserted before the first selected montage channel in the 'Edit' montage. If no montage channel is selected, they are appended at the end of the '''montage channel list.'''&lt;br /&gt;
* Drag the selected montage channels to a position you want to insert them and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Control'''&amp;lt;/span&amp;gt; key while you release the mouse button. The selected montage channels are copied and inserted at the current mouse position.&lt;br /&gt;
&lt;br /&gt;
Other ways of adding new montage channels are possible in the '''2D view or Pgr/Icr view.'''&lt;br /&gt;
&lt;br /&gt;
'''Sorting Montage Channels'''&lt;br /&gt;
&lt;br /&gt;
Drag the selected montage channel(s) with the mouse to the new list position. When releasing the mouse button, the selected montage channels are cut from their current positions and inserted at the new position.&lt;br /&gt;
&lt;br /&gt;
'''Changing the Reference'''&lt;br /&gt;
&lt;br /&gt;
Changing the reference of a montage channel is not possible in the montage channel list. Please use the 2D view instead, as described in the section [[BESA_Research_Montage_Editor#Changing_the_Reference_of_Montage_Channels|Changing the Reference of Montage Channels]]&lt;br /&gt;
&lt;br /&gt;
=== Editing a Montage in the 3D View ===&lt;br /&gt;
&lt;br /&gt;
It is currently not possible to edit a montage in the 3D view. Please use the '''2D''' '''view '''and the '''montage channel list''' instead and refer to the corresponding chapters.&lt;br /&gt;
&lt;br /&gt;
== Loading and Saving Montages  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Saving Montages ===&lt;br /&gt;
&lt;br /&gt;
In the Montage Editor, the ''''Edit' montage''', '''user montages,''' and '''additional channel''' '''montages''' can be saved. If the 'Edit' montage has been saved using the default settings, it is saved in the User Montages folder and is available from the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Usr'''&amp;lt;/span&amp;gt; button (user montages) in the main window of the BESA Reasearch program.&lt;br /&gt;
&lt;br /&gt;
If a montage is saved under a filename which is already used by another montage, the other montage is unloaded. A message box will inform the user before this happens.&lt;br /&gt;
&lt;br /&gt;
If a montage is saved (or loaded) using the same file base name as an existing montage (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Besa Research\Montages\UserMontages\Test.mtg'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''C:\Temp\Test.mtg'''&amp;lt;/span&amp;gt;), the montage label will receive the appendix “(2)” (''Test (2)'') etc.&lt;br /&gt;
&lt;br /&gt;
Please note that the file selector dialog box which is displayed if a montage is going to be saved (or loaded) provides an additional selection list at the bottom of the dialog box. The ''Folders'' selection list can be used to switch to predefined folders, e.g. the current data file folder, to the ''User Montages'' folder or to the ''Additional Channels'' folder. The list also shows recently used folders. &lt;br /&gt;
&lt;br /&gt;
By default, the extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mtg'''&amp;lt;/span&amp;gt; and the User Montages folder is proposed for saving edited montages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Saving Additional Channel Montages ===&lt;br /&gt;
&lt;br /&gt;
If you specify the extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.sel'''&amp;lt;/span&amp;gt; when selecting the montage filename, you define that the saved montage belongs to the '''additional channel montages'''. Any other extension will result in adding the montage to the '''user montages''' after saving. Please make sure that you save additional channel montages either in the standard Additional Channel Montages folder or in the current data folder if you want to use the montage only for a specific data file.&lt;br /&gt;
&lt;br /&gt;
Note that you can use the filter selection list close to the bottom of the file selector dialog box to switch between “common” montages and additional channel montages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Loading Montages ===&lt;br /&gt;
&lt;br /&gt;
To load a montage that is not located in the current data folder or in the User Montages or Additional Channel Montages folders, press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Open Montage push button'''&amp;lt;/span&amp;gt; on the toolbar or use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File / Open Montage'''&amp;lt;/span&amp;gt; menu item. Montages that have already been loaded at program start or by the user can be selected for viewing or editing via the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''User Montages'''&amp;lt;/span&amp;gt; &amp;amp;nbsp;and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Additional Channel Montages'''&amp;lt;/span&amp;gt; &amp;amp;nbsp;toolbar buttons or via the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''User Montages menu'''&amp;lt;/span&amp;gt; or the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Additional Channel Montages menu'''&amp;lt;/span&amp;gt; (please see online help chapter ''&amp;quot;Montage Editor / Reference / Popup Menus&amp;quot;'' for detailed information).&lt;br /&gt;
&lt;br /&gt;
If a montage has already been loaded, it is not reloaded unless the file has been modified – e.g. by saving a montage file in the BESA Source Analysis module.&lt;br /&gt;
&lt;br /&gt;
Note that several montages can be selected in the file selector dialog box to be loaded simultaneously.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Automatic Loading of Montages ===&lt;br /&gt;
&lt;br /&gt;
The Montage Editor loads montages found at default locations automatically:&lt;br /&gt;
&lt;br /&gt;
* At program start, all montages found in the ''User Montages folder'' or the ''Additional'' ''Channel Montages folder'' (and first-level subfolders) are loaded. They are displayed in the first section of the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''User Montages menu'''&amp;lt;/span&amp;gt; or the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Additional Channel Montages '''&amp;lt;/span&amp;gt;menu.&lt;br /&gt;
* If the current data file in the main program is switched or a new data file is loaded, all montages&amp;lt;/span&amp;gt;''' '''&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;found in the new data folder are loaded. They are displayed in the second section of the&amp;lt;/span&amp;gt;''' &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;User Montages menu'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* If a source montage file is stored in the BESA Source Analysis module, it is automatically loaded and displayed in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''User montages menu.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard Montages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Montage Editor provides several standard montages which can be applied to all EEG data files. The standard montages are subdivided into three groups:&lt;br /&gt;
&lt;br /&gt;
* '''Recorded Standard Montages''' which are based on the recorded electrodes of the current&lt;br /&gt;
* '''Virtual Standard Montages''' which are based on virtual electrodes at predefined locations, and&lt;br /&gt;
* '''Standard Source Montages''' which are used to remontage the measured data to show the estimated underlying brain activity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additionally, several predefined '''additional channel montages''' are available which can be applied to all EEG data files or to data files that contain the corresponding channels, e.g. EKG.&lt;br /&gt;
&lt;br /&gt;
* '''Predefined Additional Channel Montages''' are used to display eye activity and EKG or sphenoidal channels below the main montage channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See the next sections for details on the different standard montages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recorded Standard Montages  ===&lt;br /&gt;
&lt;br /&gt;
Recorded standard montages are sets of predefined channel configurations based on the recorded electrodes of the current data file. In the Montage Editor, recorded standard montages can be selected &lt;br /&gt;
&lt;br /&gt;
using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Recorded Standard Montages popup menu'''&amp;lt;/span&amp;gt; which opens after clicking onto the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Recorded Standard Montages'''&amp;lt;/span&amp;gt; toolbar button or activating the corresponding menu entry in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Montage menu.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Original Recording''' and '''Original Average Reference''' '''montage''' have the same sequence of electrodes as the original recorded data. The other recorded standard montages (as well as the '''virtual standard montages''') are derived from predefined montage lists based on a standard set of 27 10-10 electrodes (Std-27):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                      Fp1 Fpz Fp2&lt;br /&gt;
&lt;br /&gt;
                 F9 F7 F3 Fz F4 F8 F10&lt;br /&gt;
&lt;br /&gt;
                A1 &amp;amp;nbsp;T7 &amp;amp;nbsp;C3 &amp;amp;nbsp;Cz &amp;amp;nbsp;C4 &amp;amp;nbsp;T8 &amp;amp;nbsp;A2&lt;br /&gt;
&lt;br /&gt;
                 P9 P7 P3 Pz P4 P8 P10&lt;br /&gt;
&lt;br /&gt;
                        O1 Oz O2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Std-27 set includes the 21 electrodes of the 10-20 standard with some traditional labels replaced by the newer 10-10 standard (e.g. T3=T7, T5=P7). If the traditional 10-20 labeling is not set after program installation, it can be restored by entering the following lines in the BESA initialization file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BESA.ini'''&amp;lt;/span&amp;gt; under section [Electrodes]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Electrodes]&lt;br /&gt;
&lt;br /&gt;
T7=T3&lt;br /&gt;
&lt;br /&gt;
P7=T5&lt;br /&gt;
&lt;br /&gt;
T8=T4&lt;br /&gt;
&lt;br /&gt;
P8=T6&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will relabel the names of these electrodes everywhere in the program. Thus, the standard-27 electrode set will be displayed as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                      Fp1 Fpz Fp2&lt;br /&gt;
&lt;br /&gt;
                 F9 F7 F3 Fz F4 F8 F10&lt;br /&gt;
&lt;br /&gt;
                A1 &amp;amp;nbsp;T3 &amp;amp;nbsp;C3 &amp;amp;nbsp;Cz &amp;amp;nbsp;C4 &amp;amp;nbsp;T4 &amp;amp;nbsp;A2&lt;br /&gt;
&lt;br /&gt;
                 P9 T5 P3 Pz P4 T6 P10&lt;br /&gt;
&lt;br /&gt;
                        O1 Oz O2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A predefined montage channel is only displayed in the '''2D view''', if the recording electrode set contains an electrode that is equal to or close to its location (e.g. A1, T9, TP9 or P9 will be indicated). If the predefined montage channel is bipolar, e.g. A1-Cz, the recording electrode set has to contain electrodes with locations equal or close to the location of both channel (here A1) and reference (here Cz). Otherwise, the montage channel is not displayed in the 2D view. It is grayed in the '''montage channel list''' and the suffix “[NA]” is appended (“not available”).&lt;br /&gt;
&lt;br /&gt;
If the common reference used for recording is a known single electrode, the common reference electrode is regarded as part of the recording electrode set. Predefined montage channels using the common reference can be displayed. The common reference will be included in the computation of the average reference. This is not possible, however, for EEG systems using a combination of electrodes as the common reference.&lt;br /&gt;
&lt;br /&gt;
The following recorded standard montages are available:&lt;br /&gt;
&lt;br /&gt;
* Average Reference&lt;br /&gt;
* Double Banana&lt;br /&gt;
* Triple Banana&lt;br /&gt;
* Horizontal Bipolar&lt;br /&gt;
* A1/A2 Reference&lt;br /&gt;
* Referential&lt;br /&gt;
* Original Recording&lt;br /&gt;
* Original Average Reference&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Average Reference ====&lt;br /&gt;
&lt;br /&gt;
In this traditional montage, the available channels of the Std-27 electrode set are displayed against the average reference. The average reference is computed for each time point as the mean voltage over the amplitudes of all scalp electrodes that are not bad. If the common reference used for recording is a known single electrode, it will be included in the computation of the average reference.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (41).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Double Banana ====&lt;br /&gt;
&lt;br /&gt;
This is a longitudinal bipolar montage containing two left hemispheric, two right hemispheric and one midline longitudinal row of montage channels. Longitudinal rows are arranged from front to back. Predefined montage channels are only displayed if both channel and reference are available (i.e. recorded and not bad).&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (42).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Triple Banana ====&lt;br /&gt;
&lt;br /&gt;
The Triple Banana montage is an extended longitudinal bipolar montage. It has an additional inferior row on each side as compared to the '''Double Banana''' montage. Predefined montage channels are only displayed if both channel and reference are available (i.e. recorded and not bad). The Triple Banana montage is not available if less than 2 inferior electrodes are recorded or defined as ‘good’ on each side.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (43).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Horizontal Bipolar ====&lt;br /&gt;
&lt;br /&gt;
The horizontal bipolar montage contains three transversal rows of montage channels. Transversal rows are arranged from left to right. Predefined montage channels are only displayed if both the channel and reference are available (i.e. recorded and not bad).&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (44).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A1/A2 Reference ==== &lt;br /&gt;
&lt;br /&gt;
In this traditional montage, the available left-hemispheric channels of the Std-27 electrode set (except inferior electrodes F9, A1, P9) are displayed against the electrode A1 (or, if A1 is not available, a nearby channel such as P9 &amp;gt; T9 &amp;gt; TP9 &amp;gt; M1). The available right-hemispheric channels of the Std-27 electrode set (except inferior electrodes F10, A2, P10) are displayed against the electrode A2 (or a nearby channel such as P10 &amp;gt; T10 &amp;gt; TP10 &amp;gt; M2). The available midline electrodes of the Std-27 electrode set (except Fpz and Oz) are displayed twice, referenced a) to A1 and b) A2 (or a nearby channel). If neither A1 nor A2 nor one of the nearby channels are recorded or defined as ‘good’, the A1/A2 Reference montage is not available.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (45).png]]&lt;br /&gt;
&lt;br /&gt;
For this example, the electrodes A1 and A2 are not available. Therefore, the electrodes T9 and T10 have been used instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Referential ====&lt;br /&gt;
&lt;br /&gt;
In this traditional montage, the available channels of the Std-27 electrode set are displayed against a common 'viewing reference'. The default viewing reference is Cz. Any of the recording electrodes in the EEG file may be used as viewing reference.&lt;br /&gt;
&lt;br /&gt;
For details on how to change the viewing reference, see chapter [[BESA_Research_Montage_Editor#Changing_the_Viewing_Reference_in_Referential_Montages|Changing the Viewing Reference]].&lt;br /&gt;
&lt;br /&gt;
Note that the viewing reference is independent of the common reference used for recording.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (46).png]]&lt;br /&gt;
&lt;br /&gt;
==== Original Recording ====&lt;br /&gt;
&lt;br /&gt;
This montage displays the data as recorded. Note that channels defined as 'bad' are displayed in the '''2D view''' and '''Pgr/Icr view''' with grey color. In this case, the montage channel label is grayed in the '''montage channel list.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (47).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Original Average Reference ====&lt;br /&gt;
&lt;br /&gt;
In this montage, the scalp electrodes are displayed in the recording sequence, versus average reference. The average reference is computed for each time point as the mean voltage over the amplitudes of all scalp electrodes that are not bad.&lt;br /&gt;
&lt;br /&gt;
If the common reference is a known single electrode, it will be included in the computation of the average reference.&lt;br /&gt;
&lt;br /&gt;
This montage is not available if the current data file contains no electrodes (e.g. a pure MEG data file).&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (48).png]]&lt;br /&gt;
&lt;br /&gt;
=== Virtual Standard Montages ===&lt;br /&gt;
&lt;br /&gt;
Virtual standard montages are sets of predefined channel configurations based on virtual electrodes. In the Montage Editor, virtual standard montages can be selected using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Virtual Standard Montages popup menu'''&amp;lt;/span&amp;gt; which opens after clicking onto the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Virtual Standard Montages'''&amp;lt;/span&amp;gt; toolbar button or activating the corresponding menu entry in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Montage menu'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The virtual montages except ''Reference Free'' (10-10) and ''CSD-Laplacian'' (10-10) use predefined montage lists based on the same standard set of 27 10-10 electrodes (Std-27) as the recorded standard montages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                      Fp1 Fpz Fp2&lt;br /&gt;
&lt;br /&gt;
                 F9 F7 F3 Fz F4 F8 F10&lt;br /&gt;
&lt;br /&gt;
                A1 &amp;amp;nbsp;T7 &amp;amp;nbsp;C3 &amp;amp;nbsp;Cz &amp;amp;nbsp;C4 &amp;amp;nbsp;T8 &amp;amp;nbsp;A2&lt;br /&gt;
&lt;br /&gt;
                 P9 P7 P3 Pz P4 P8 P10&lt;br /&gt;
&lt;br /&gt;
                       O1 Oz O2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Std-27 set includes the 21 electrodes of the international 10-20 electrode standard with four traditional labels named according to the newer 10-10 standard (T3=T7, T4=T8, T5=P7, T6=P8). For the standard coordinates of the 27 electrode locations on the sphere see help chapter [[Electrodes_and_Surface_Locations#Recommendations_for_electrode_placement|Recommendations for Electrode Placement]]. ''Reference Free'' (10-10) and ''CSD-Laplacian'' (10-10) use predefined montage lists based on a standard set of 81 10-10 electrodes.&lt;br /&gt;
&lt;br /&gt;
Virtual montages estimate the voltage at the idealized locations of the standard 27 (81) electrodes on a sphere using spherical spline interpolation. This method is described in Perrin et al. (Electroenceph. clin. Neurophysiol. 72:184-187, 1989); for more details please refer to chapter “''Mapping / Spherical Spline'' ''Maps”''. Using this interpolation, EEG traces can also be displayed for missing or bad electrodes. The use of interpolation is indicated by the keyword ‘virtual’ displayed in the upper left corner of the waveform window above the montage channel labels. In principal, spherical spline interpolation is possible outside the area covered by the recording electrodes. Over the lower half of the head, interpolation benefits greatly from the presence of inferior lateral electrodes (F9, A1, P9, F10, A2, P10). Although only a minimum of 2 separate channels with lower lateral electrodes is required, for example, A1/A2 or M1/M2, the use of 6 or 4 inferior lateral electrodes is recommended.&lt;br /&gt;
&lt;br /&gt;
'''Note''': If the number of scalp electrodes is less than 12, virtual standard montages are not available since spline interpolation and interpolated montages cannot be computed. &lt;br /&gt;
&lt;br /&gt;
The following virtual standard montages are available:&lt;br /&gt;
&lt;br /&gt;
* Reference Free&lt;br /&gt;
* 10-10 Average&lt;br /&gt;
* CSD-Laplacian&lt;br /&gt;
* Double Banana&lt;br /&gt;
* Triple Banana&lt;br /&gt;
* Horizontal Bipolar&lt;br /&gt;
* A1/A2 Reference&lt;br /&gt;
* Combined Ears&lt;br /&gt;
* Referential&lt;br /&gt;
* Reference Free (10-10)&lt;br /&gt;
* CSD-Laplacian (10-10)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For more details on the different virtual standard montages see help chapter ''&amp;quot;Montage Editor / Standard Montages / Virtual Standard Montages&amp;quot;.'' --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - Reference Free'''&lt;br /&gt;
&lt;br /&gt;
In this montage, the standard 27 interpolated channels are displayed against a reference free average reference. The reference is estimated as the mean voltage over 642 equidistant locations covering the whole head sphere. Voltages are calculated by spherical spline interpolation. According to physics, the voltage integral over the outer surface of the head is zero. By using the mean voltage over the whole head as the reference a close approximation of the true zero reference is obtained.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (49).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - 10-10 Average'''&lt;br /&gt;
&lt;br /&gt;
In this montage, the standard 27 interpolated channels are displayed against a virtual average reference. The average reference is computed for each time point as the mean voltage over the interpolated amplitudes of the extended 81 standard virtual scalp electrodes. Since this standard covers inferior electrodes, the 10-10 virtual average reference is not much different from the reference-free montage.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (50).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - CSD-Laplacian'''&lt;br /&gt;
&lt;br /&gt;
In this montage, current source density (Laplacian) for each of the standard 27 interpolated electrodes is displayed. The CSD waveforms and maps are computed as the second spatial derivative by spherical spline interpolation and are implicitly reference-free. Because this method intrinsically uses information from all electrodes, it provides a more accurate estimation of the source current leaving and entering the skull than source derivations using only 3 or 4 neighboring electrodes. This is particularly true for electrodes at the boundary of the electrode array.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (51).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - Double Banana'''&lt;br /&gt;
&lt;br /&gt;
This is a longitudinal bipolar montage containing two left hemispheric, two right-hemispheric and one midline longitudinal row of montage channels. Longitudinal rows are arranged from front to back. All channels are interpolated.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (52).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - Triple Banana'''&lt;br /&gt;
&lt;br /&gt;
The Triple Banana montage is an extended longitudinal bipolar montage. It has an additional inferior row on each side as compared to the Double Banana montage. All channels are interpolated.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (53).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - Horizontal Bipolar'''&lt;br /&gt;
&lt;br /&gt;
The horizontal bipolar montage contains three transversal rows of montage channels. &lt;br /&gt;
&lt;br /&gt;
Transversal rows are arranged from left to right. All channels are interpolated.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (54).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - A1/A2 Reference'''&lt;br /&gt;
&lt;br /&gt;
In this montage, the left-hemispheric channels of the standard 27 interpolated channels (except inferior electrodes F9, A1, P9) are displayed against the interpolated voltage at electrode A1. The right-hemispheric channels of the standard 27 interpolated channels (except inferior electrodes F10, A2, P10) are displayed against the interpolated voltage at electrode A2. The midline electrodes of the standard 27 interpolated channels (except Fpz and Oz) are displayed twice, referenced a) to the interpolated voltage at electrode A1 and b) to the interpolated voltage at electrode A2.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (55).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - Combined Ears'''&lt;br /&gt;
&lt;br /&gt;
In this montage, the standard 27 interpolated channels are referenced to a computed virtual linked ears reference. The reference is calculated as the mean voltage of the interpolated amplitudes at A1 and A2 determined by spherical spline interpolation. The calculation of the average potential at the ears balances both sides correctly in contrast to the unknown bias when linking the ears or mastoid electrodes directly.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (56).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - Referential'''&lt;br /&gt;
&lt;br /&gt;
In this montage, the standard 27 interpolated channels are displayed against a common virtual 'viewing reference'. The default viewing reference is Cz virtual. Any of the extended 81 standard virtual electrodes may be used as viewing reference.&lt;br /&gt;
&lt;br /&gt;
For details on how to change the viewing reference, see the help chapter [[BESA_Research_Montage_Editor#Changing_the_Viewing_Reference_in_Referential_Montages|Changing the Viewing Reference]].&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (57).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - Reference Free (10-10)'''&lt;br /&gt;
&lt;br /&gt;
In this montage, the extended standard 81 electrode channels are displayed using spherical spline-interpolation and the reference-free mode. The reference is estimated as described for the ''Reference Free'' montage. This montage yields more detailed spatial information as compared to the reference-free 27 channel montage described above.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (58).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Virtual Standard Montage - CSD-Laplacian (10-10)'''&lt;br /&gt;
&lt;br /&gt;
In this montage, current source density (Laplacian) for each of the standard 81 interpolated electrodes is displayed. The CSD is computed as described for the ''CSD-Laplacian'' montage. This montage may yield more spatial information than the 27 channel CSD-Laplacian montage described above.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (59).png]]&lt;br /&gt;
&lt;br /&gt;
=== Standard Source Montages ===&lt;br /&gt;
&lt;br /&gt;
BESA Research provides several standard brain source montages for EEG review. The majority of these were derived from a set of 15 regional sources covering lateral and midline frontal, central and parietal cortex, midline fronto-polar and occipito-polar cortex as well as anterior and posterior temporal lobes bilaterally. The new source space 25s was derived from 25 sources below the standard 25 electrodes of the IFCN.&lt;br /&gt;
&lt;br /&gt;
The following standard sources montages are provided:&lt;br /&gt;
* 25s&lt;br /&gt;
* BR_Brain Regions&lt;br /&gt;
* FR_Frontal Region&lt;br /&gt;
* CR_Central Region&lt;br /&gt;
* PR_Parietal Region&lt;br /&gt;
* TR_Temporal Region&lt;br /&gt;
* Evoked Potentials and MEG&lt;br /&gt;
* Resting State Montages&lt;br /&gt;
&lt;br /&gt;
'''The frontal, central and parietal brain source montages (FR, CR, PR)''' were derived from the montage BR_Brain Regions in order to emphasize the respective regions in the display. They show the three source activities of each right and left lateral brain region separately along with the 13 other regional sources. The three source activities of each selected region are represented by three '''single dipoles''' with radial and tangential orientations. The activities of the right and left dipoles are displayed in the top six source channels of these montages.&lt;br /&gt;
&lt;br /&gt;
'''The montage focusing onto the temporal lobe''' have 4 dipoles in each temporal lobe to reveal temporal-basal, polar, antero-lateral and postero-lateral source activities. The basal and polar sources are oriented tangentially, the lateral sources radially. The montage TR_Temporal Region separates these 4 aspects of the temporal lobe against the source currents in the other 11 regions irrespective of their orientation.&lt;br /&gt;
&lt;br /&gt;
'''The resting state montages''' contain regional sources in brain regions associated with the Default Mode Network (DMN), fronto-parietal task control system as well as the dorsal attention system and the ventral attention system. They allow investigating resting state EEG and MEG data in a swift and straight-forward manner. For a more detailed description of the resting state montages, see [[#Standard Source Montage - Resting State Montages|Resting State Source Montages]].&lt;br /&gt;
&lt;br /&gt;
'''Brain source montages''' are provided to facilitate the detection of focal source processes in the brain by reversing the overlap from different brain regions seen at the scalp. If brain activity is focal, i.e. represented predominantly in one source waveform, a large amount of the recorded scalp activity reflected in this trace will originate in the related brain region. If source activity is distributed over several traces, the origin is likely to be more widespread or in areas not precisely modelled by the combination of sources in the selected source montage. Each channel in a brain source montage can be viewed as a 'gross virtual electrode' placed onto a particular brain region.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Standardized brain source montages are defined for the 81 standard 10-10 electrodes. Therefore, the recording montage is first interpolated onto the 81 standard electrodes. Then the source waveforms are calculated using the source montage file.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Source montages are labeled using a specific [[#Naming Scheme of Standard Sources|naming scheme]] to characterize the location, orientation, and type of the underlying source.&lt;br /&gt;
&lt;br /&gt;
'''Note''': If the number of scalp electrodes is less than 12, source montages cannot be computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Naming Scheme of Standard Sources ====&lt;br /&gt;
&lt;br /&gt;
The label of a source channel used in a standard source montage is a combination of the source label itself and the abbreviation of the montage label (separated by an underscore '_'). &lt;br /&gt;
&lt;br /&gt;
The source label starts with an abbreviation of the '''brain region '''in which the source is located. &lt;br /&gt;
&lt;br /&gt;
The following abbreviations are available:&lt;br /&gt;
&lt;br /&gt;
* '''C''' ('''c'''entral),&lt;br /&gt;
* '''F''' ('''f'''rontal),&lt;br /&gt;
* '''Fp''' ('''f'''ronto-'''p'''olar),&lt;br /&gt;
* '''Op''' ('''o'''ccipito-'''p'''olar),&lt;br /&gt;
* '''P''' ('''p'''arietal),&lt;br /&gt;
* '''TA''' ('''t'''emporal '''a'''nterior),&lt;br /&gt;
* '''TB''' ('''t'''emporal '''b'''asal), and&lt;br /&gt;
* '''TP''' ('''t'''emporal '''p'''osterior)&lt;br /&gt;
&lt;br /&gt;
If the source is a '''single dipole''' (and no '''regional source'''), the '''dipole orientation''' is given in the next lower case character. The orientations are specified as follows:&lt;br /&gt;
&lt;br /&gt;
* '''p''' ('''p'''olar),&lt;br /&gt;
* '''r''' ('''r'''adial),&lt;br /&gt;
* '''ta''' ('''t'''angential '''a'''nterior),&amp;amp;nbsp;&lt;br /&gt;
* '''tm''' ('''t'''angential '''m'''edial),&lt;br /&gt;
* '''tv''' ('''t'''angential '''v'''ertical), and&amp;amp;nbsp;&lt;br /&gt;
* '''v''' ('''v'''ertical).&lt;br /&gt;
&lt;br /&gt;
The last letter before the underscore ('_') which separates the abbreviation of the montage name specifies the '''hemisphere''':&lt;br /&gt;
&lt;br /&gt;
* '''L''' ('''l'''eft hemisphere),&lt;br /&gt;
* '''M''' ('''m'''idline), and&amp;amp;nbsp;&lt;br /&gt;
* '''R''' ('''r'''ight hemisphere).&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
* TAL_BR: '''t'''emporal '''a'''nterior regional source, '''l'''eft hemisphere, source montage '''''BR'''_Brain Regions''&lt;br /&gt;
* FprM_TA: '''f'''ronto-'''p'''olar '''r'''adial single dipole source, '''m'''idline, source montage '''''TA'''_Temporal Lobe''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Source space 25s ====  &lt;br /&gt;
''(requires BESA Research 7.0 or higher)''&lt;br /&gt;
&lt;br /&gt;
The new source space 25s is based on sources below the standard 25 electrodes of the IFCN (International Federation of Clinical Neurophysiology). The sequence of channels is a reasonable compromise between transversal and longitudinal arrangements while an optimal separation of the major regions, i.e. frontal, central, temporal and parietal-occipital, has been achieved. At the same time, easy hemispheric comparison has been enabled for the frontal and parietal-occipital regions as well as for the left and right temporal channels by grouping these close to each other in the middle of the source space 25s. Thus, when looking at the 25s channels from top to bottom – like onto the head - we are going from frontal to central, include both temporal lobes, and then continue to parietal and occipital.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:25s_screenshot.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The source channels F9_25s (shown above) and F10_25s have been chosen to reflect mainly temporal polar activity while T9_25s and T10_25s reflect mainly basal activities of the right and left temporal lobes. All other sources reflect primarily the superficial activity of the cortex below each electrode (negative up, dipoles are pointing into cortex). Thus, focal activity (e.g. spikes and some EEG rhythms) can be associated more easily with the regions of origin. Compare focal EEG activity in source space 25s with the montages AV25 (average reference, virtual electrodes), CA25 (common average, recorded electrodes) and RF25 (reference-free, virtual) in folder UserMontages which have a comparable sequence of channels (press Usr for selection).&lt;br /&gt;
&lt;br /&gt;
Below, spike 1 in Examples\Epilepsy\Spikes\SpikeExamples.fsg is displayed. The comparison shows the leading left temporal basal activity most clearly in the new source space 25s:&lt;br /&gt;
&lt;br /&gt;
[[Image:25s_screenshot2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Standard Source Montage - BR_Brain Regions ====&lt;br /&gt;
&lt;br /&gt;
This source montage uses a set of 15 regional sources covering lateral and midline frontal, central and parietal cortex, midline fronto-polar and occipito-polar cortex as well as anterior and posterior temporal lobes bilaterally. It separates the activities of the 15 different brain regions and provides for fast comparison and quantification of the different activities.&lt;br /&gt;
&lt;br /&gt;
Note: If the data contains '''MEG channels''', the corresponding MEG montages ''BRM ''(for magnetometers and axial gradiometers) and ''BRG'' (for planar gradiometers) are located in subfolder '''MEG'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Montage_Editor_(60).png|thumb|350px|&amp;lt;br&amp;gt;Highlight on the left temporal anterior (TAL) regional source.]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Montage_Editor_(61).png|thumb|350px|Highlight on the left frontal (FL) regional source. The two temporal sources in the foreground are still visible.]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Montage_Editor_(62).png|thumb|350px|Highlight on the central midline (CM) regional source. The left-side sources in the foreground are also visible.]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
[[Image:Montage Editor (60).png]]&lt;br /&gt;
&lt;br /&gt;
''Highlight on the left temporal anterior (TAL) regional source.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (61).png]]&lt;br /&gt;
&lt;br /&gt;
''Highlight on the left frontal (FL) regional source. The two temporal sources in the foreground are still visible.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (62).png]]&lt;br /&gt;
&lt;br /&gt;
''Highlight on the central midline (CM) regional source. The left-side sources in the foreground are also visible.''&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Standard Source Montage - CR_Central Region ====&lt;br /&gt;
&lt;br /&gt;
This source montage displays the radial and tangential activities of the central brain region bilaterally in the first 6 '''single dipole''' channels. The other 13 '''regional sources''' separate the source activities arising from the other brain regions.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If the data contains '''MEG channels''', the corresponding MEG montages ''BRM'' (for magnetometers and axial gradiometers) and ''BRG'' (for planar gradiometers) are located in subfolder '''MEG.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (63).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Standard Source Montage - FR_Frontal Region ====&lt;br /&gt;
&lt;br /&gt;
This source montage displays the radial and tangential activities of the frontal brain region bilaterally in the first 6 '''single dipole''' channels. The other 13 '''regional sources''' separate the source activities arising from the other brain regions.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If the data contains '''MEG channels''', the corresponding MEG montages ''BRM'' (for magnetometers and axial gradiometers) and ''BRG'' (for planar gradiometers) are located in subfolder '''MEG'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (64).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Standard Source Montage - PR_Parietal Region ====&lt;br /&gt;
&lt;br /&gt;
This source montage displays the radial and tangential activities of the parietal brain region bilaterally in the first 6 '''single dipole''' channels. The other 13 '''regional sources''' separate the source activities arising from the other brain regions.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If the data contains '''MEG channels''', the corresponding MEG montages ''BRM'' (for magnetometers and axial gradiometers) and ''BRG'' (for planar gradiometers) are located in subfolder''' MEG'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (65).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Standard Source Montage - TR_Temporal Region ====&lt;br /&gt;
&lt;br /&gt;
This source montage displays the activities of four different aspects of the temporal lobe bilaterally in the first 8 dipole traces. There are 4 equivalent dipole sources in each temporal lobe to reveal temporal-basal, polar, antero-lateral and postero-lateral source activities. The basal and polar sources are oriented tangentially, the lateral sources radially. The montage TR_Temporal Region separates these 4 aspects of the temporal lobe from the source currents in the other 11 regions irrespective of their orientation. Head schemes illustrate location and orientation of each virtual electrode.&lt;br /&gt;
&lt;br /&gt;
The ''Temporal Lobe'' and ''Temporal Region'' montages may be used to facilitate the detection of lateralized temporal lobe activities and of the differences of the activities at the various spatial aspects of both temporal lobes. Note that eye movement artifacts may be well represented by the sources at the tip of the temporal lobe due to similarities in the scalp distribution of the related source activities.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If the data contains '''MEG channels''', the corresponding MEG montages ''BRM ''(for magnetometers and axial gradiometers) and ''BRG'' (for planar gradiometers) are located in subfolder '''MEG'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (66).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Evoked Potentials ====&lt;br /&gt;
&lt;br /&gt;
BESA Research provides three standard source montages designed specifically for use with '''auditory (AEP), somatosensory (SEP), and visual (VEP) evoked data'''. Brain regions that are specifically relevant for the auditory, somatosensory, and visual pathway, respectively, are modeled with equivalent current dipoles. The remaining brain regions are modelled with regional sources. '''The Evoked Potentials source montages are available for EEG only'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Standard Source Montage - Resting State Montages ====&lt;br /&gt;
&lt;br /&gt;
===== Introducing Resting State Networks =====&lt;br /&gt;
&lt;br /&gt;
The default mode network (DMN) is the most commonly known brain network associated with resting state activity. It comprises brain regions that become less active, when the subject is engaged with a task, and in turn more active when the subject is resting (Raichle, MacLeod et al. 2001; Buckner, Andrews-Hanna et al. 2008). Thinking of the DMN as a “baseline” state of the brain would be misleading, as DMN brain regions have been linked with remembering the past, envisioning future events, and considering the thoughts and perspectives of other people (Buckner, Andrews-Hanna et al. 2008). This internal reflection is likely to happen when the brain is not otherwise engaged and the corresponding network thus becomes active in resting state. Recent research (Power, Cohen et al. 2011; Bressler and Menon 2010) has shown that several other brain networks known to become active during certain tasks can also be identified in resting state. Among them are the fronto-parietal task control system as well as the dorsal and ventral attention system (Power, Cohen et al. 2011). These networks seem to be stable systems that are internally connected even when no particular task is given. The resting state networks DMN, fronto-parietal task control system as well as the dorsal attention system and the ventral attention system are available in BESA Research as source montages. They allow investigating resting state EEG and MEG data in a swift and straight-forward manner. &lt;br /&gt;
&lt;br /&gt;
===== How the Resting State Source Montages were created =====&lt;br /&gt;
&lt;br /&gt;
BESA resting state source montages are based on source solutions, for which regional sources were placed at the MNI locations of the brain regions of interest. Source locations were derived from the following publications:&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=5&lt;br /&gt;
|DMN || Power, Cohen et al. 2011, Supplementary Information&lt;br /&gt;
|-&lt;br /&gt;
|Fronto-Parietal Task Control Network || Dosenbah, Fair et al. 2007&lt;br /&gt;
|-&lt;br /&gt;
|Dorsal Attention Network || Power, Cohen et al. 2011, Supplementary Information&lt;br /&gt;
|-&lt;br /&gt;
|Ventral Attention Network || Corbetta and Shulman 2002&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Image:Montage Editor (67).png]] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bilateral Sources representing the same brain regions that were not perfectly symmetrical were symmetrized favoring the position of the less superficial source. &lt;br /&gt;
&lt;br /&gt;
Additional noise sources were placed to increase the sensitivity of the sources of interest. Noise sources are easily identified by their name.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (68).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Naming scheme of the resting state montages =====&lt;br /&gt;
&lt;br /&gt;
* Occ: Occipital lobe&lt;br /&gt;
* Fr (or Front): Frontal lobe&lt;br /&gt;
* Par: Parietal lobe&lt;br /&gt;
* Temp: Temporal lobe&lt;br /&gt;
* a: Anterior&lt;br /&gt;
* p: Posterior&lt;br /&gt;
* L: Left&lt;br /&gt;
* R: Right&lt;br /&gt;
* M: Middle&lt;br /&gt;
&lt;br /&gt;
DMN:&lt;br /&gt;
&lt;br /&gt;
* PCC: Posterior cingulate cortex&lt;br /&gt;
* mPFC: Medial prefrontal cortex&lt;br /&gt;
* AG: Angular gyrus&lt;br /&gt;
* LatTemp: Lateral temporal cortex&lt;br /&gt;
&lt;br /&gt;
Dorsal Attention Network:&lt;br /&gt;
&lt;br /&gt;
* FEF: Frontal eye fields&lt;br /&gt;
* IPS: Intraparietal sulcus&lt;br /&gt;
 &lt;br /&gt;
Fronto-Parietal Task Control Network:&lt;br /&gt;
&lt;br /&gt;
* dlPFC: Dorsolateral prefrontal cortex&lt;br /&gt;
* IPL: Inferior parietal lobule&lt;br /&gt;
* IPS: Intraparietal sulcus&lt;br /&gt;
&lt;br /&gt;
Ventral Attention Network:&lt;br /&gt;
&lt;br /&gt;
* IFG: Inferior frontal gyrus&lt;br /&gt;
* MFG: Middle frontal gyrus&lt;br /&gt;
* TPJ: Temporoparietal junction&lt;br /&gt;
* STG: Superior temporal gyrus&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Applying Resting State Source Montages on your data =====&lt;br /&gt;
&lt;br /&gt;
For '''EEG''' data, the resting state source solutions were saved as source montages and are automatically available from the Menu '''&amp;quot;Montage / Source / Resting State Montages&amp;quot;'''. All sources are regularized with a regularization constant of 1%.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (69).png]]&lt;br /&gt;
&lt;br /&gt;
For '''MEG''' data, source montages are not pre-saved as there are varying MEG sensor types depending on the MEG system and manufacturer. MEG users should send a segment of their raw data to source analysis and load the desired source solution in the source analysis module. &lt;br /&gt;
&lt;br /&gt;
Source solutions for resting state networks can be found here: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''“C:\Program Files (x86)\BESA\Research_6_0\Montages\SourceMontages\Resting State Montages”.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After loading the source solution, it is possible to save it as a source montage with &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File / Save Source Montage As.'''&amp;lt;/span&amp;gt; The source montage will now be applied on the data in the main window and is also available from the menu option &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Montage / User-Defined'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Mean FFT Analysis in Resting State Source Space =====&lt;br /&gt;
&lt;br /&gt;
Before applying the desired resting state source montage on the raw data, artifacts should be dealt with either by artifact correction and/or artifact rejection (as part of the mean FFT scan). &lt;br /&gt;
&lt;br /&gt;
After applying the resting state source montage, a mean FFT can be calculated on the source waveforms associated with the source channels, i.e. the ongoing brain activity in the resting state network. Mean FFT performs block-wise FFTs on the whole dataset and the mean output is created when the end of the file is reached. Hereby, information can be drawn on the frequency content of the whole dataset. &lt;br /&gt;
&lt;br /&gt;
Mean FFT can be started from the menu &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Mean FFT Spectrum'''&amp;lt;/span&amp;gt;. The dialogue allows specifying the data range (by default all data) and the block length, BESA Research will use for calculating individual FFTs. Artifact thresholds for the source channels can also be defined. Mean FFT’s output will give an overview of the frequency content of the individual source channels.&lt;br /&gt;
&lt;br /&gt;
===== TFC Analysis in Resting State Source Space =====&lt;br /&gt;
&lt;br /&gt;
For TFC analysis in BESA Research, it is required to insert triggers in the raw resting state data. This can be done by pressing &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Insert Triggers'''&amp;lt;/span&amp;gt;. After insertion of the triggers, a paradigm must be created (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Edit Paradigm'''&amp;lt;/span&amp;gt;) that will allow the calculation of the time-frequency plots based on the inserted triggers in the final tab. Please make sure that any filters are only applied for artifact scanning in the filter tab and not for “averaging”, as this would also reduce the frequency domain for time-frequency analysis. &lt;br /&gt;
&lt;br /&gt;
For TFC analysis of resting state data it is recommendable to not use any baseline correction in the paradigm window. If possible, however, a control resting condition should be used (e.g. eyes open / eyes closed) that can be contrasted with the resting state condition of interest in the time-frequency window.&lt;br /&gt;
&lt;br /&gt;
In the time-frequency display, the results should be displayed as absolute values (the ABS button [[Image:Montage Editor (70).png]] )&lt;br /&gt;
&lt;br /&gt;
If a control condition is available the two resting state conditions can also be contrasted by pressing the according subtraction button ([[Image:Montage Editor (71).png]]).&lt;br /&gt;
&lt;br /&gt;
Coherence can be calculated between any resting state source channel and all other channels:&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (72).png]]&lt;br /&gt;
&lt;br /&gt;
''This example shows resting state connectivity between the right-frontal source (red label) and the left-frontal source, as well as the right dorso-lateral prefrontal cortex. No strong coherence is found with the other network sources or the noise sources.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is possible to apply beamformer and / or DICS analysis on the time-frequency range of interest, suggesting the following possible workflow:&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (73).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
# Bressler, S. L. and V. Menon (2010). &amp;quot;Large-scale brain networks in cognition: emerging methods and principles.&amp;quot; Trends Cogn Sci 14(6): 277-290.&lt;br /&gt;
# Buckner, R. L., J. R. Andrews-Hanna, et al. (2008). &amp;quot;The brain's default network: anatomy, function, and relevance to disease.&amp;quot; Ann N Y Acad Sci 1124: 1-38.&lt;br /&gt;
# Corbetta, M. and G. L. Shulman (2002). &amp;quot;Control of goal-directed and stimulus-driven attention in the brain.&amp;quot; Nat Rev Neurosci 3(3): 201-215.&lt;br /&gt;
# Dosenbach, N. U., D. A. Fair, et al. (2007). &amp;quot;Distinct brain networks for adaptive and stable task control in humans.&amp;quot; Proc Natl Acad Sci U S A 104(26): 11073-11078.&lt;br /&gt;
# Power, J. D., A. L. Cohen, et al. (2011). &amp;quot;Functional network organization of the human brain.&amp;quot; Neuron 72(4): 665-678.&lt;br /&gt;
# Raichle, M. E., A. M. MacLeod, et al. (2001). &amp;quot;A default mode of brain function.&amp;quot; Proc Natl Acad Sci USA 98(2): 676-682.&lt;br /&gt;
&lt;br /&gt;
=== Predefined Additional Channel Montages ===&lt;br /&gt;
&lt;br /&gt;
Predefined '''additional channel montages''' may be used to display eye activity and EKG or sphenoidal channels in addition to the main montage channels.&lt;br /&gt;
&lt;br /&gt;
In the Montage Editor, additional channel montages can be selected using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Additional Channel'''&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Montages'''&amp;lt;/span&amp;gt; popup menu. Open this menu by clicking onto the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Additional Channel Montages toolbar'''&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''button '''&amp;lt;/span&amp;gt;or activate the corresponding entry in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Montage'''&amp;lt;/span&amp;gt; menu.&lt;br /&gt;
&lt;br /&gt;
The following predefined additional channel montages are available:&lt;br /&gt;
&lt;br /&gt;
* EKG&lt;br /&gt;
* EOG-HB&lt;br /&gt;
* EOG-HV&lt;br /&gt;
* EOG-HVB&lt;br /&gt;
* EKG+EOG-HB&lt;br /&gt;
* EKG+EOG-HV&lt;br /&gt;
* EKG+EOG-HVB&lt;br /&gt;
* Sphenoidals_Avr&lt;br /&gt;
* Sphenoidals_Bip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional Channel Montage - EKG'''&lt;br /&gt;
&lt;br /&gt;
This additional channel montage defines several polygraphic EKG channels. Depending on the recorded channels of your data file, the available EKG channel or channel combination is used.&lt;br /&gt;
&lt;br /&gt;
Note that this montage is not available if the current data file does not contain any EKG channels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Montage Editor (74).png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use different conventions for defining EKG channels, you may edit this montage in the Montage Editor using copy and paste from the ''Original Recording'' montage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional Channel Montage - EOG-HB'''&lt;br /&gt;
&lt;br /&gt;
This virtual additional channel montage automatically generates a horizontal EOG channel (H_EOG) and an eye blink channel (B_EOG) from the recorded EEG scalp electrodes using spherical splines interpolation to the standard 81 electrodes and a source montage that contrasts brain and eye activity. It is recommended to reference all electrodes including electrodes near the eyes, e.g. F11, F12, LO1, LO2, IO1, IO2, to the common reference, because this virtual montage can then better separate eye and brain activities (cf. Berg and Scherg, 1994). Special bipolar EOG channels cannot be used in this calculation and are, therefore, not recommended.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (75).png]]&lt;br /&gt;
&lt;br /&gt;
''The display shows the equivalent centers of the spatial components reflecting the topographies of horizontal eye movements (black) and eye blinks (green).''&lt;br /&gt;
&lt;br /&gt;
This automatic virtual montage is currently available for EEG data files only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional Channel Montage - EOG-HV'''&lt;br /&gt;
&lt;br /&gt;
This virtual additional channel montage automatically generates a horizontal (''H_EOG'') and a vertical (''V_EOG'') EOG channel from the recorded EEG scalp electrodes using spherical splines interpolation to the standard 81 electrodes and a source montage that contrasts brain and eye activity. It is recommended to reference all electrodes including electrodes near the eyes, e.g. ''F11, F12, LO1, LO2'', ''IO1, IO2,'' to the common reference, because this virtual montage can then better separate eye and brain activities (cf. Berg and Scherg, 1994). Special bipolar EOG channels cannot be used in this calculation and are, therefore, not recommended.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (76).png]]&lt;br /&gt;
&lt;br /&gt;
''The display shows the equivalent centers of the spatial components reflecting the topographies of horizontal (black) and vertical (blue) eye movements.''&lt;br /&gt;
&lt;br /&gt;
This automatic virtual montage is currently available for EEG data files only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional Channel Montage - EOG-HVB'''&lt;br /&gt;
&lt;br /&gt;
This '''additional channel montage''' is a combination of the '''EOG-HB''' and the '''EOG-HV''' additional channel montages. Please see there for a detailed description.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional Channel Montage - EKG+EOG-HB'''&lt;br /&gt;
&lt;br /&gt;
This '''additional channel montage''' is a combination of the '''EKG''' and the '''EOG-HB''' additional channel montages. Please see there for a detailed description.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional Channel Montage - EKG+EOG-HV'''&lt;br /&gt;
&lt;br /&gt;
This '''additional channel montage''' is a combination of the '''EKG''' and the '''EOG-HV''' additional channel montages. Please see there for a detailed description.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional Channel Montage - EKG+EOG-HVB'''&lt;br /&gt;
&lt;br /&gt;
This '''additional channel montage''' is a combination of the '''EKG, '''the '''EOG-HB''', and the '''EOG-HV''' additional channel montages. Please see there for a detailed description.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional Channel Montage - Sphenoidals_Avr'''&lt;br /&gt;
&lt;br /&gt;
This '''additional channel montage''' allows to display sphenoidal electrodes referenced against the common average reference in parallel with any recorded, virtual, or source montage for comparison.&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (77).png]]&lt;br /&gt;
&lt;br /&gt;
If the current data file has no channels labeled'' SP1'' and ''SP2'', this montage is not available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional Channel Montage - Sphenoidals_Bip'''&lt;br /&gt;
&lt;br /&gt;
This '''additional channel montage''' allows to display sphenoidal electrodes using a bipolar reference in parallel with any recorded, virtual, or source montage for comparison. The reference is ''T3/T4'' (or ''T7/T8'') to enhance the hemispheric difference of vertical activity resulting from the activation of the inferior surface of the temporal lobe. Note that the standard source montage ''TR_Temporal Region'' provides for a better hemispheric separation of right and left temporal lobe activities (see e.g. example &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''EEG-Focus\EEG2.eeg'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[[Image:Montage Editor (78).png]]&lt;br /&gt;
&lt;br /&gt;
If the current data file has no channels labeled ''SP1'' and'' SP2'', this montage is not available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Wrong_characters_in_BESA_software</id>
		<title>Wrong characters in BESA software</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Wrong_characters_in_BESA_software"/>
				<updated>2021-05-26T08:55:25Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 7.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Problem description =&lt;br /&gt;
&lt;br /&gt;
Recently Windows 10 introduced multi-language support. This can however cause troubles with displaying special characters in any type of software (i.e. µV). Instead, you can see something similar to this:&lt;br /&gt;
&lt;br /&gt;
[[File:CharactersProblem.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:CharactersProblem02.png|400px]]&lt;br /&gt;
 &lt;br /&gt;
= Solution =&lt;br /&gt;
&lt;br /&gt;
To solve this you need to change your system &amp;quot;Region &amp;amp; language&amp;quot; preferences.&lt;br /&gt;
* Please press the Start button on the taskbar, and press the settings button (the cogwheel icon). &lt;br /&gt;
* Select '''Time &amp;amp; Language''' section&lt;br /&gt;
* Select '''Region &amp;amp; language'''&lt;br /&gt;
** A window similar to the screenshot below will be displayed:&lt;br /&gt;
&lt;br /&gt;
[[File:CharactersProblemReason.png|800px]]&lt;br /&gt;
&lt;br /&gt;
* First, select '''Administrative language settings''' on the right side of the &amp;quot;Settings&amp;quot; window.&lt;br /&gt;
* Select '''Administrative''' tab of the &amp;quot;Region&amp;quot; window and then press '''Change system locale...''' button.&lt;br /&gt;
** Check if '''Beta: Use Unicode UTF-8 for worldwide language support''' is checked in the &amp;quot;Region Settings&amp;quot; window. If it is checked, please uncheck it.&lt;br /&gt;
** NOTE: If wrong characters are displayed in BESA Research after unchecking the above option, please change the '''Current system locale:''' to '''English (United States)''' in the &amp;quot;Region Settings&amp;quot; window.&lt;br /&gt;
&lt;br /&gt;
[[File:Characterproblemsolution2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
You may also need to install the proper language configuration. Press the '''Add a language''' button and select the language pack that is the correct one for you. After installation is complete, make sure that the new language pack is at the top of the list. Alternatively, you can also select one of the installed languages if there is any. When you click on the selected language the up and down arrow will be shown. Press the up arrow until the selected language is at the top. You should end up with a configuration similar to this one:&lt;br /&gt;
&lt;br /&gt;
[[File:CharactersProblemSolution.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Once this is done you may close all the windows and restart BESA Research. If the problem still persists try to install another language pack or contact [https://www.besa.de/support/support-page/ BESA support]&lt;br /&gt;
&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Visualization_with_BESA_Plot_in_FieldTrip</id>
		<title>Visualization with BESA Plot in FieldTrip</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Visualization_with_BESA_Plot_in_FieldTrip"/>
				<updated>2021-05-06T12:10:31Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Plot&lt;br /&gt;
|version = BESA Plot 1.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[http://www.besa.de/downloads/besa-plot/ BESA Plot] is a free tool created by Dr Patrick Berg ([http://www.besa.de/ BESA GmbH]) for visualization of MEEG data. Initially, it was meant to be a complementary visualization tool to [http://www.besa.de/products/besa-research/besa-research-overview/ BESA Research], however, it could be used in a more general context. In this document, we demonstrate the possibility of using BESA Plot as a visualization tool in the [https://www.mathworks.com/ MATLAB] based open-source package for MEEG data analysis [http://www.fieldtriptoolbox.org/ FieldTrip].&lt;br /&gt;
&lt;br /&gt;
Since BESA Plot can be started with command-line arguments, it can be called directly from MATLAB and the required input parameters (e.g. data file, settings and plotting modalities) can be committed as such arguments. There are four files necessary for starting BESA Plot from MATLAB and visualizing the corresponding data:&lt;br /&gt;
# a data file (e.g. test1.avr)&lt;br /&gt;
# a file containing the channel labels and coordinates (e.g. test1.elp)&lt;br /&gt;
# a control file containing the plotting commands for BESA Plot (e.g. test1.bpctrl)&lt;br /&gt;
# a dataset file containing general information about the data file (e.g. test1.avr.dataset)&lt;br /&gt;
These files should be generated dynamically in MATLAB in order to be able to plot the MATLAB data in BESA Plot.&lt;br /&gt;
&lt;br /&gt;
== Procedure ==&lt;br /&gt;
&lt;br /&gt;
=== Generating the data file (.avr) ===&lt;br /&gt;
&lt;br /&gt;
First of all we need the data which are going to be saved as an avr-file. This is usually a MATLAB structure generated  in FieldTrip with the function &amp;lt;tt&amp;gt;ft_timelockanalysis&amp;lt;/tt&amp;gt;. Its general form is something like this:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
       avg: [147x271 double]&lt;br /&gt;
       var: [147x271 double]&lt;br /&gt;
      time: [1x271 double]&lt;br /&gt;
       dof: [147x271 double]&lt;br /&gt;
     label: {147x1 cell}&lt;br /&gt;
    dimord: 'chan_time'&lt;br /&gt;
      grad: [1x1 struct]&lt;br /&gt;
       cfg: [1x1 struct]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to create a data file from that structure, one needs the function &amp;lt;tt&amp;gt;besa_save2Avr&amp;lt;/tt&amp;gt; which can be found in the FieldTrip installation in the folder &amp;lt;tt&amp;gt;external\besa&amp;lt;/tt&amp;gt; or can be downloaded directly from [https://www.besa.de/wp-content/uploads/2020/10/MATLAB2BESA.zip BESA Homepage]. Just unpack the archive and add the path to the MATLAB path (e.g. &amp;lt;code&amp;gt;addpath('D:\Path\to\MATLAB2BESA')&amp;lt;/code&amp;gt;).&lt;br /&gt;
Use the function like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
status = besa_save2Avr(cfg.datapath, DataFile, data_matrix, ...&lt;br /&gt;
        time_samples, channel_labels, data_scale_factor, time_scale_factor);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generating the channel file (*.elp) ===&lt;br /&gt;
&lt;br /&gt;
This file contains the channel type, the channel labels and the spherical coordinates of the channels. It can be created using the function &amp;lt;tt&amp;gt;besa_save2Elp&amp;lt;/tt&amp;gt; again from the package &amp;lt;tt&amp;gt;MATLAB2BESA&amp;lt;/tt&amp;gt;. Use the function like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
status = besa_save2Elp(cfg.datapath, ElpFile, ...&lt;br /&gt;
        SphericalCoords, channel_labels, channel_type);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating the BESA Plot control file (*.bpctrl) ===&lt;br /&gt;
&lt;br /&gt;
This is the actual plotting script. It follows the syntax of a scripting language defined in BESA Plot. For more details about the scripting language please refer to the program help. For this file format there is no writer function, since it can contain different scripts for different visualization scenarios. One possible script for plotting two dipoles in a schematic head could look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
set color=black&lt;br /&gt;
set size=16&lt;br /&gt;
set dipole number=1 xloc=0.65 yloc=0.16 zloc=0.29 xori=0.15 yori=-0.73 zori=-0.67 color=blue length=0.1 diameter=0.05&lt;br /&gt;
set dipole number=2 xloc=-0.65 yloc=0.16 zloc=0.29 xori=-0.17 yori=-0.57 zori=-0.81 color=blue length=0.1 diameter=0.05&lt;br /&gt;
head width=35 height=40 viewpoint=top brain=on x=20.0 y=75.0&lt;br /&gt;
head width=35 height=40 viewpoint=back brain=on x=20.0 y=30.0&lt;br /&gt;
head width=35 height=40 viewpoint=left brain=on x=77.0 y=77.0&lt;br /&gt;
set dataset=1&lt;br /&gt;
set mapuV=18&lt;br /&gt;
set mapcolor negative=blue positive=red electrode=none&lt;br /&gt;
set mapsize=35&lt;br /&gt;
set maptype=amplitude&lt;br /&gt;
set maplambda=1E-5&lt;br /&gt;
set mapviewpoint=top&lt;br /&gt;
set maprange maximumuV=461 minimumuV=-419 zerouV=0.0 contours=on&lt;br /&gt;
map latency=110.6 end=150.4 step=20 mean=on label=on x=77.0 y=30.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows the result after running the script in BESA Plot with the data (.avr) and channel (.elp) files.&lt;br /&gt;
&lt;br /&gt;
[[File:DipoleFitResults.png|thumb|500px|c|none|Figure 1. Dipole fitting results visualized with BESA Plot]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the dataset file (*.dataset) ===&lt;br /&gt;
&lt;br /&gt;
The dataset file contains basic information about the data in the data file. It is not essential for the visualization process, however, if it is missing, the program asks the user additional questions about the settings before generating the image. The dataset file can be created with the function &amp;lt;tt&amp;gt;besa_save2Dataset&amp;lt;/tt&amp;gt; which also in the package &amp;lt;tt&amp;gt;MATLAB2BESA&amp;lt;/tt&amp;gt;. Use the function like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
status = besa_save2Dataset(DatasetPath, DataFile, ...&lt;br /&gt;
    ElpFile, ControlFile, NumChannels, NumTimeSamples, ...&lt;br /&gt;
    SamplingInterval, FirstTimeSample);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Starting BESA Plot with command line arguments ===&lt;br /&gt;
&lt;br /&gt;
After the generation of the input files, one can start BESA Plot with these files as input to visualize data in '''command line'''. The syntax of the call is: &amp;lt;code&amp;gt;BesaPlot &amp;lt;data_file_name&amp;gt; &amp;lt;control_file_name&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
start /b cmd /c &amp;quot;&amp;quot;C:\Program Files (x86)\BESA\Plot\BesaPlot.exe&amp;quot; &amp;quot;D:\Path\to\erf1.avr&amp;quot; &amp;quot;D:\Path\to\erf1.bpctrl&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;start /b cmd /c&amp;lt;/code&amp;gt; is used to start the program in background.&lt;br /&gt;
&lt;br /&gt;
== Predefined plotting functions for data from FieldTrip ==&lt;br /&gt;
&lt;br /&gt;
There are two functions available in [https://my.hidrive.com/share/9rw3-to96j#$/ here (MATLAB2BESA_BESAPlot.zip)] or the external toolbox folder of &amp;lt;tt&amp;gt;FieldTrip&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;external\besa&amp;lt;/tt&amp;gt;, this folder can be added to the MATLAB path using the following fieldtrip command: &amp;lt;code&amp;gt;ft_hastoolbox('besa', 1)&amp;lt;/code&amp;gt;) which can be used to plot directly data from FieldTrip with BESA Plot.&lt;br /&gt;
* &amp;lt;tt&amp;gt;besa_plotFtSensorLevelMaps&amp;lt;/tt&amp;gt;: for sensor level MEEG data generated by &amp;lt;tt&amp;gt;ft_timelockanalysis&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;besa_plotFtDipoleResults&amp;lt;/tt&amp;gt;: for dipole fit data resulted from &amp;lt;tt&amp;gt;ft_dipolefitting&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The image gained with the function &amp;lt;tt&amp;gt;besa_plotFtSensorLevelMaps&amp;lt;/tt&amp;gt; is shown in Figure 2 and the one generated with the function &amp;lt;tt&amp;gt;ft_dipolefitting&amp;lt;/tt&amp;gt; is shown in Figure 1.&lt;br /&gt;
&lt;br /&gt;
The functions can be called like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
cfg = [];&lt;br /&gt;
cfg.badchannels  = 1;  % number of bad channels&lt;br /&gt;
cfg.latency      = [0.000 0.250]; % interval of interest in seconds&lt;br /&gt;
cfg.timestep     = 0.020; % time interval between two plots&lt;br /&gt;
cfg.besaplot     = '&amp;quot;C:\Program Files (x86)\BESA\Plot\BesaPlot.exe&amp;quot;'; % path to BESA Plot&lt;br /&gt;
cfg.filebasename = 'erf1'; % basename for the generated files&lt;br /&gt;
cfg.datapath     = 'D:\Data\BesaPlot'; % folder where to save the generated files&lt;br /&gt;
&lt;br /&gt;
status = besa_plotFtSensorLevelMaps(cfg, data_avg);&lt;br /&gt;
% data_avg: A structure resulting from the function ft_timelockanalysis.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:AverageResults.png|thumb|500px|c|none|Figure 2 Visualization of sensor level data with BESA Plot]]&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
cfg = [];&lt;br /&gt;
cfg.badchannels  = 1; % number of bad channels&lt;br /&gt;
cfg.besaplot     = '&amp;quot;C:\Program Files (x86)\BESA\Plot\BesaPlot.exe&amp;quot;'; % path to BESA Plot&lt;br /&gt;
cfg.filebasename = 'megdatafile'; % basename for the generated files&lt;br /&gt;
cfg.datapath     = 'D:\Data\BesaPlot'; % folder where to save the generated files&lt;br /&gt;
&lt;br /&gt;
status = besa_plotFtDipoleResults(cfg, data_avg, dipole_source);&lt;br /&gt;
% data_avg: A structure resulting from the function ft_timelockanalysis.&lt;br /&gt;
% dipole_source: A structure resulting from the function ft_dipolefitting.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that there are two possible ways to customize the plots:&lt;br /&gt;
# Change the section &amp;quot;'''Write the control file'''&amp;quot; in the plotting functions &amp;lt;tt&amp;gt;besa_plotFtSensorLevelMaps&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;besa_plotFtDipoleResults&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# After the plots were created, use BESA Plot to change the images.&lt;br /&gt;
&lt;br /&gt;
For more information about which visualization possibilities are available in BESA Plot, please read the program help or check the [http://www.besa.de/downloads/besa-plot/ feature list].&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]] [[Category:BESA Plot]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Batch_Processing</id>
		<title>Batch Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Batch_Processing"/>
				<updated>2021-05-05T15:46:57Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: Redirected page to BESA Research Batch Processing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[BESA Research Batch Processing]]&lt;br /&gt;
&lt;br /&gt;
{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 5.2 or higher&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== BESA batches allow you to automate nearly all analysis steps in BESA ==&lt;br /&gt;
The batch functionality that you find under the “Process” menu has been around for a while. Over the past few years, the toolkit that is available there has grown to an impressive size, such that with BESA Research 6.0, virtually all analysis steps can be automated, and applied to a list of files. At any point in time, the batch can also be halted to make parameter adjustments, should this be necessary. A complete analysis from pre-filtering, artifact scanning, averaging, source analysis, and export of results for subsequent statistical analysis, can be summarized in few steps. For many recurring tasks, ready-made batches are available already – and batches can also be assigned to function keys for maximum ease of use. &lt;br /&gt;
&lt;br /&gt;
The set of available commands is shown below – sub-divided into &lt;br /&gt;
*general commands which allow e.g. loops, error handling, or pausing the batch for user input&lt;br /&gt;
*commands affecting the main program including ERP management&lt;br /&gt;
*commands for discrete source analysis&lt;br /&gt;
*commands for distributed source analysis&lt;br /&gt;
*time-frequency commands&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BatchMenu.jpg|none|left]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, to automate averaging and to prepare data for statistical analysis, using an experimental paradigm for a number of subjects, a batch could have the following elements:&lt;br /&gt;
*Load the paradigm&lt;br /&gt;
*Perform an artifact scan &lt;br /&gt;
*Average the conditions&lt;br /&gt;
*Export the data of each condition for further analysis with BESA Statistics&lt;br /&gt;
&lt;br /&gt;
In batch code, this will look like the following:&lt;br /&gt;
&lt;br /&gt;
[[File:BatchExample.png|none|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add any command, e.g. “Average”, select the command from the list of commands and check the options dialog that appears:&lt;br /&gt;
&lt;br /&gt;
[[File:BatchExampleAv.png|700px|none|left]]&lt;br /&gt;
&lt;br /&gt;
Left side: First click the &amp;quot;Add Command&amp;quot; button. Then select a command from the list. Right side: After selecting, a dialog opens where command options can be defined.&lt;br /&gt;
&lt;br /&gt;
Once the batch is complete, it can run over all open files, over a user-defined file list (simply drag files into the list from Explorer), or just over the current file. Note that these batches are produced without entering any line of code by hand – it is all done using the graphical user interface of the Batch dialog.&lt;br /&gt;
&lt;br /&gt;
== An example batch for Averaging step by step ==&lt;br /&gt;
The first two commands will load the paradigm file and perform the artifact scan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Paradigm(%Scripts%\Paradigm\Auditory\AEP_Intensity.PDG)&lt;br /&gt;
ArtifactScan(Wait)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BatchArtScan.png|500px|none|left]] &lt;br /&gt;
&lt;br /&gt;
The next command will average over the conditions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Average(%basename%_av, %Examples%\ERP-Auditory-Intensity\Averages\, NoDefaultName,OverwriteTarget, NoCorrect)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:BatchExampleAv2.png|500px|none|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next commands will loop over the first 5 segments (condition averages) and export them to different ASCII files to be used in further processing in BESA Statistics or other programs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAINFileOpen(%Examples%\ERP-Auditory-Intensity\Averages\%basename%_av.fsg)&lt;br /&gt;
GENFor(segm, 1, 5, 1, 1)&lt;br /&gt;
MAINMarkBlock(WholeSegment,-,%segm%)&lt;br /&gt;
MAINExport(%basename%-export%segm%, \, Segment, ASCvec, Original, FiltOff, NoResample, Replace, -, )&lt;br /&gt;
GENEndFor()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:BatchExampleAv3.png|500px|none|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Of course, many more options are available – check it out! For example, segments can automatically be sent to Source Analysis to perform automated imaging and export these results for further analysis, too. &lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Batch_Error_Handling</id>
		<title>Batch Error Handling</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Batch_Error_Handling"/>
				<updated>2021-05-05T14:56:41Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 5.2 till 6.0&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This page informs about possible issues when running batches, and how to resolve them.&lt;br /&gt;
&lt;br /&gt;
=== Several batches message box ===&lt;br /&gt;
If upon starting a batch the following info box appears:&lt;br /&gt;
[[File:Batch_error_1.png|none]]&lt;br /&gt;
&lt;br /&gt;
Then it is possible that a previous instance of BESA Research has not shut down correctly, and there may still be a process of BESA Research running in the background. You can check for this by &lt;br /&gt;
* closing BESA Research&lt;br /&gt;
* right-clicking in the taskbar at the bottom of your window, and selecting the Task Manager. Select the tab &amp;quot;Processes&amp;quot; and display the background processes. There should be no background process running for BESA Research. However, it is likely that there are (hence the message box above). In this case:&lt;br /&gt;
** Either log off and on again, or &lt;br /&gt;
** Close the BESA Research background processes in the Task Manager (by right-click on the corresponding row in the Task Manager display).&lt;br /&gt;
&lt;br /&gt;
Then re-start BESA Research.&lt;br /&gt;
&lt;br /&gt;
=== Batch error 183 ===&lt;br /&gt;
It can occasionally happen that a batch can not be started, and informs you that the batch error 183 occurred (could not set up batch logging).&lt;br /&gt;
The reason (and the fix) is most likely the same as described above. If not, logging off and on again (or, in the worst-case scenario, re-booting the computer) will unlock the handle to the log file. &lt;br /&gt;
&lt;br /&gt;
'''Note''': This problem should be fixed from version 6.1 January 2017 onwards.&lt;br /&gt;
&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Batch_Error_Handling</id>
		<title>Batch Error Handling</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Batch_Error_Handling"/>
				<updated>2021-05-05T14:53:19Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 5.2 or higher&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This page informs about possible issues when running batches, and how to resolve them.&lt;br /&gt;
&lt;br /&gt;
=== Several batches message box ===&lt;br /&gt;
If upon starting a batch the following info box appears:&lt;br /&gt;
[[File:Batch_error_1.png|none]]&lt;br /&gt;
&lt;br /&gt;
Then it is possible that a previous instance of BESA Research has not shut down correctly, and there may still be a process of BESA Research running in the background. You can check for this by &lt;br /&gt;
* closing BESA Research&lt;br /&gt;
* right-clicking in the taskbar at the bottom of your window, and selecting the Task Manager. Select the tab &amp;quot;Processes&amp;quot; and display the background processes. There should be no background process running for BESA Research. However, it is likely that there are (hence the message box above). In this case:&lt;br /&gt;
** Either log off and on again, or &lt;br /&gt;
** Close the BESA Research background processes in the Task Manager (by right-click on the corresponding row in the Task Manager display).&lt;br /&gt;
&lt;br /&gt;
Then re-start BESA Research.&lt;br /&gt;
&lt;br /&gt;
=== Batch error 183 ===&lt;br /&gt;
It can occasionally happen that a batch can not be started, and informs you that the batch error 183 occurred (could not set up batch logging).&lt;br /&gt;
The reason (and the fix) is most likely the same as described above. If not, logging off and on again (or, in the worst-case scenario, re-booting the computer) will unlock the handle to the log file. &lt;br /&gt;
&lt;br /&gt;
'''Note''': This problem should be fixed from version 6.1 January 2017 onwards.&lt;br /&gt;
&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Best_Strategy_to_Define_a_Multiple_Source_Model</id>
		<title>Best Strategy to Define a Multiple Source Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Best_Strategy_to_Define_a_Multiple_Source_Model"/>
				<updated>2021-05-05T14:52:46Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
== General ==&lt;br /&gt;
The best strategy to define a multiple source model is usually a sequential spatio-temporal approach. However, this may depend on the data to be analyzed. For strategies and examples, please read the key papers on multiple source analysis in [http://www.besa.de/publications/methods Publications/Methods].&lt;br /&gt;
== Guidelines ==&lt;br /&gt;
The following guidelines apply to discrete source analysis in general:&lt;br /&gt;
&lt;br /&gt;
# The idea behind source analysis is to place or fit sources into the brain at all regions contributing to the data. Localization/fitting is hypothesis testing: The computed source waveforms separate the modeled brain activities and answer the question if and when activity takes place in the modeled brain region. Thus BESA Research reconstructs brain activity with high temporal resolution.&lt;br /&gt;
# Synchronous activity over several square cm can be modelled by a single equivalent source.&lt;br /&gt;
# Sources that are close together, have the same orientation and synchronous activity are indistinguishable.&lt;br /&gt;
# Sources that are close together but have different orientations and non-synchronous activity can well be separated by a discrete source model.&lt;br /&gt;
# Source waveforms are relatively insensitive to variations in dipole location. Therefore a single regional source can accurately model the activity of multiple gray matter patches in its vicinity. Regional sources should have a mutual distance of approximately 3cm or more between each other to prevent crosstalk of their source waveforms.&lt;br /&gt;
# Regional sources tend to provide more reliable solutions in noisy data as compared to single dipoles, because during a fit of a regional source only its location needs to be determined (no orientation has to be fitted).&lt;br /&gt;
# Very often the brain responds to a stimulus with bilateral symmetrical activation. Therefore, a pair of symmetrical regional sources is often a good initial source configuration. The resulting source waveforms will then indicate if the activity is really bilateral.&lt;br /&gt;
# The criterion for a good source model is not solely the residual variance. Rather, the following criteria should be met:&lt;br /&gt;
#* The source model should be in agreement with proven knowledge about the underlying brain activity (e.g. bilateral activation of the auditory cortex after an auditory stimulus as opposed to a single central brain area).&lt;br /&gt;
#* The source waveforms are an important indicator for the quality of a source model: When the time course of the obtained source waveforms for a (pair of) source(s) are distinctly different from those of other sources, this indicates that the corresponding source correctly models distinct brain activity. On the contrary, when two source waveforms show nearly the same time course, it should be checked if they pick up the activity of a brain region that is not part of the model, rather than truly modelling brain activity generated at their source locations.&lt;br /&gt;
#* PCA can be helpful in determining the minimum number of sources required to adequately model the data.&lt;br /&gt;
&lt;br /&gt;
[[Category:Source Analysis]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Running_BESA_Research_on_the_Mac</id>
		<title>Running BESA Research on the Mac</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Running_BESA_Research_on_the_Mac"/>
				<updated>2021-05-05T14:49:41Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 6.0 or higher&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can run BESA Research on the Mac by means of a Windows emulator.&lt;br /&gt;
&lt;br /&gt;
There are several systems available:&lt;br /&gt;
* Open source software&lt;br /&gt;
** [https://www.virtualbox.org/ Oracle VM VirtualBox]&lt;br /&gt;
* Commercial software&lt;br /&gt;
** Parallels Desktop for Mac [https://en.wikipedia.org/wiki/Parallels_Desktop_for_Mac]&lt;br /&gt;
** VMWare Fusion [https://en.wikipedia.org/wiki/VMware_Fusion]&lt;br /&gt;
&lt;br /&gt;
=== Parallels Desktop for Mac ===&lt;br /&gt;
&lt;br /&gt;
BESA Research runs with Parallels. However, it must not be run in the so-called &amp;quot;Coherency mode&amp;quot;. This will lead to a crash. Outside this mode, BESA Research works.&lt;br /&gt;
&lt;br /&gt;
=== VMWare Fusion ===&lt;br /&gt;
&lt;br /&gt;
BESA Research runs with VMWare Fusion.&lt;br /&gt;
&lt;br /&gt;
[[Category: Setup]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Source_Coherence_Introduction_and_Concepts</id>
		<title>Source Coherence Introduction and Concepts</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Source_Coherence_Introduction_and_Concepts"/>
				<updated>2021-05-05T14:46:38Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Complete&lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Source Coherence Module - Introduction ==&lt;br /&gt;
&lt;br /&gt;
The Source Coherence Module provides new insights into the interaction between brain regions using brain source montages. These are derived from multiple source models of the data. Transforming the scalp surface into the brain signals using source montages greatly enhances the spatial resolution and largely removes one of the major drawbacks of traditional coherence analysis, the widespread overlap at the scalp due to volume conduction.&lt;br /&gt;
&lt;br /&gt;
The Source Coherence Module provides a variety of tools for time-frequency based event-related data analysis.&lt;br /&gt;
* Time-frequency diagrams based on brain source or surface channels&lt;br /&gt;
* Display of temporal-spectral evolution (TSE) in percent&lt;br /&gt;
* Separation of evoked and induced activity&lt;br /&gt;
* Joint display of time-frequency or coherence plots with the evoked potential of individual channels&lt;br /&gt;
* Coherence estimate between any combination of surface or source channels (coherence or phase coherence)&lt;br /&gt;
* Computation and display of phase delay and latency difference between channels in a graphically defined time and frequency window&lt;br /&gt;
* Display of the inter-trial phase locking (ITPL)&lt;br /&gt;
* Comparison of two conditions&lt;br /&gt;
* Probability plots transforming all time-frequency parameters into statistical p-values&lt;br /&gt;
* Export of analysis results into ASCII text files&lt;br /&gt;
&lt;br /&gt;
Time-frequency transforms are obtained in a very fast implementation based on complex demodulation. Apart from source channels, intracranial channels, and scalp channels, also other polygraphic channels, e.g. rectified EMG, can be included in the analysis.&lt;br /&gt;
&lt;br /&gt;
A highly optimized graphical user interaction enables fast testing of hypotheses, and quick focusing on the features of interest.&lt;br /&gt;
&lt;br /&gt;
For an introduction and an outline of the underlying concepts of source coherence, please continue with the next topic, &amp;quot;[[Source_Coherence_Introduction_and_Concepts#Concepts_of_Source_Coherence|''Concepts of Source Coherence'']]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For more details check the following topics:&lt;br /&gt;
* [[Source_Coherence_Introduction_and_Concepts#Layout_of_the_Source_Coherence_Window|Layout of the Source Coherence Window]]&lt;br /&gt;
* Reference (in the BESA help)&lt;br /&gt;
&lt;br /&gt;
Please also refer to our website at http://www.besa.de for the latest tutorial on source coherence and related topics.&lt;br /&gt;
&lt;br /&gt;
== Concepts of Source Coherence ==&lt;br /&gt;
&lt;br /&gt;
Recently, an increasing number of papers on oscillatory coupling between brain regions in animal studies and on time-frequency analysis of human EEG and MEG data has been published. BESA Research introduces several tools for fast and user-friendly time-frequency analysis including source and scalp coherence.&lt;br /&gt;
&lt;br /&gt;
First, let us introduce some terminology in order to clarify the concepts:&lt;br /&gt;
* Surface waveform: a time signal recorded from EEG-electrodes or MEG sensors&lt;br /&gt;
* Source waveform: a time signal calculated for a specified brain region or cortical surface&lt;br /&gt;
* Source montage: the transformation of the on-going EEG into the estimated contributions or source waveforms of a set of brain regions&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (1).gif ]]&lt;br /&gt;
&lt;br /&gt;
* Time-frequency analysis: analysis or display of the event-related time-locked or induced activity in the time-frequency domain&lt;br /&gt;
* Time-locked activity: event-related signal with similar wave shape over trials&lt;br /&gt;
* Induced activity: oscillatory activity occurring in a certain event-related time window with varying time lag and phase&lt;br /&gt;
* Oscillatory activity: activity occurring with several oscillations in a narrow frequency band; can be time-locked and/or induced&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (2).gif ]]&lt;br /&gt;
&lt;br /&gt;
* TSE: temporal spectral evolution, change in amplitude or power over time relative to the baseline interval&lt;br /&gt;
* ERD/ERS: event-related (de)-synchronization, used as a synonym for TSE&lt;br /&gt;
* ERSP: event-related spectral perturbations, change in power or amplitude over time. This is the more general term and comprises ERD/ERS/TSE that is related to baseline.&lt;br /&gt;
* Correlation: correlation between two time signals, i.e. scalar product of normalized signals in time domain&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
* Spectral-temporal density function S(f,t) = A(f,t)*e&amp;lt;sup&amp;gt;i*ϕ(f,t)&amp;lt;/sup&amp;gt;: quantifies amplitude A and phase ϕ of a signal at a certain frequency f and latency t relative to an event&lt;br /&gt;
* Coherence: squared correlation of two spectral density functions S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;(f,t) and S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(f,t) over trials, i.e. squared scalar product of S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;(f,t) and S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(f,t) over trials, normalized across all trials&lt;br /&gt;
* Phase coherence: correlation of two normalized spectral density functions S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;(f,t) and S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(f,t) over trials, quantified by the phase locking value (PLV)&lt;br /&gt;
* Phase locking value (PLV): scalar product of S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;(f,t) and S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(f,t) over trials, where S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;(f,t) and S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(f,t) are normalized, i.e. they become unit vectors in the complex plane&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (4).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Phase coherence uses only the phase relationships between channels for the coherence estimate, not the amplitudes. The method implemented here was described by Lachaux et al. (1999). Phase coherence is described by the so-called &amp;quot;phase locking value&amp;quot; (PLV).&lt;br /&gt;
&lt;br /&gt;
Comparison of the formulae for coherence and PLV illustrates that for constant amplitudes, PLV is equivalent to the square root of coherence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scalp Coherence ===&lt;br /&gt;
&lt;br /&gt;
When coherence is calculated at the surface between 2 EEG channels or 2 MEG sensors, activity from various brain regions is picked up in each of the surface channels. Oscillatory activity in one brain region can already lead to a strong coherence between 2 surface channels because of the wide distribution of focal brain activity at the surface. This is due to the nature of the dipole fields when recording remotely and due to the smearing effect of the volume conduction in EEG. As a consequence, a coherence measure between surface channels cannot distinguish between coherence due to propagation and real coherence between the oscillatory activities in two coupled brain regions.&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
Whether true coherence can be detected at the scalp, depends mainly on the relative orientation of the source currents in the underlying brain regions and, to a lesser extent, on their distance in location. In the case of the auditory cortex, for example, both the left and right temporal planes produce vertical activity with strong bilateral contributions centrally (e.g. at C3/C4 and F3/F4). The spatial correlation of the radial activities at the lateral surfaces of the superior temporal gyrus is also very large between right and left scalp electrodes, e.g. at T3/T4. A current-source density montage (CSD or Laplacian) can reduce the effects of propagation on scalp coherence to a certain extent, because it enhances the radial current from the underlying cortex relative to more remote sources to some extent.&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Source Coherence ===&lt;br /&gt;
&lt;br /&gt;
An optimal separation is obtained by a source montage derived from a multiple source model. The model is used to create an inverse spatial filter, i.e. a source montage that separates the different brain activities. Activities that are not accounted for by the model, e.g. from background noise or EEG, are distributed amongst the sources and may therefore lead to 'noise coherence' between source channels. This 'noise coherence' can be large for sources that have very similar spatial topographies. It can be reduced by increasing the regularization constant of the inverse at the expense of a larger cross-talk between the sources or by including specific sources accounting for the 'noise'.&lt;br /&gt;
&lt;br /&gt;
The principal steps to calculate a time-frequency diagram and source coherence are illustrated in the figure below for the real data example of error-related negativity (ERN). A multiple source model is created from averaged ERP data and/or sources in brain regions known to contribute from fMRI/PET studies using a similar task. The source model is then used to calculate a source montage and the source waveforms of the single trials. Next, every single trial is transformed into the time-frequency domain by selecting a certain temporal resolution using complex demodulation (a principle similar to FM radio). From the single trials, time-frequency displays are generated by averaging spectral density amplitude or power over trials. Source coherence is calculated by averaging the cross-spectral density of one reference channel with all other channels over trials and normalizing by the averaged auto-spectral densities (cf. figure above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (7).gif ]]&lt;br /&gt;
&lt;br /&gt;
In this figure, you can see the separation of the occipital alpha rhythm (top 3 source waveforms) from the frontal midline ERN components (lowest 2 traces) which become prominent in most single trials after transforming from the 128 scalp electrodes onto 9 source areas in the brain. The time-frequency display shows a strong evoked ERN activity in the anterior and posterior cingulate gyrus (CG) sources and an induced suppression and rebound of ~20 Hz activity in the sensori-motor cortex bilaterally. Alpha suppression is most prominent in the midline occipital source. A double click onto the TF display of a selected channel leads to the rapid calculation of the coherence between this channel and all other channels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For more information, see the following sections (''Layout of the Source Coherence Window'' and ''Tutorial''). --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Layout of the Source Coherence Window ==&lt;br /&gt;
&lt;br /&gt;
The source coherence window consists of&lt;br /&gt;
&lt;br /&gt;
* title bar with information on the current display mode and the data file name&lt;br /&gt;
* menu bar where the display mode and analysis options are selected&lt;br /&gt;
* toolbar for quick access to the menu functions&lt;br /&gt;
* display area where time-frequency diagrams of all channels are shown&lt;br /&gt;
* information text about the current display mode and units (e.g. Power, Amplitude, or Coherence) at the bottom left&lt;br /&gt;
* color map with minimum and maximum normalization values at the center bottom. Any value higher or lower than the normalization value is assigned the color of the normalization value&lt;br /&gt;
* information text about the condition which is analyzed at the bottom right&lt;br /&gt;
* status bar with information about the channel, frequency, latency, and signal amplitude&lt;br /&gt;
&lt;br /&gt;
[[Image:Coherence (1).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Source_Coherence_Introduction_and_Concepts</id>
		<title>Source Coherence Introduction and Concepts</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Source_Coherence_Introduction_and_Concepts"/>
				<updated>2021-05-05T14:45:17Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Complete&lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Source Coherence Module - Introduction ==&lt;br /&gt;
&lt;br /&gt;
The Source Coherence Module provides new insights into interaction between brain regions using brain source montages. These are derived from multiple source models of the data. Transforming the scalp surface into the brain signals using source montages greatly enhances the spatial resolution and largely removes one of the major drawbacks of traditional coherence analysis, the widespread overlap at the scalp due to volume conduction.&lt;br /&gt;
&lt;br /&gt;
The Source Coherence Module provides a variety of tools for time-frequency based event-related data analysis.&lt;br /&gt;
* Time-frequency diagrams based on brain source or surface channels&lt;br /&gt;
* Display of temporal-spectral evolution (TSE) in percent&lt;br /&gt;
* Separation of evoked and induced activity&lt;br /&gt;
* Joint display of time-frequency or coherence plots with the evoked potential of individual channels&lt;br /&gt;
* Coherence estimate between any combination of surface or source channels (coherence or phase coherence)&lt;br /&gt;
* Computation and display of phase delay and latency difference between channels in a graphically defined time and frequency window&lt;br /&gt;
* Display of the inter-trial phase locking (ITPL)&lt;br /&gt;
* Comparison of two conditions&lt;br /&gt;
* Probability plots transforming all time-frequency parameters into statistical p-values&lt;br /&gt;
* Export of analysis results into ASCII text files&lt;br /&gt;
&lt;br /&gt;
Time-frequency transforms are obtained in a very fast implementation based on complex demodulation. Apart from source channels, intracranial channels, and scalp channels, also other polygraphic channels, e.g. rectified EMG, can be included into the analysis.&lt;br /&gt;
&lt;br /&gt;
A highly optimized graphical user interaction enables a fast testing of hypotheses, and quick focusing onto the features of interest.&lt;br /&gt;
&lt;br /&gt;
For an introduction and an outline of the underlying concepts of source coherence, please continue with the next topic, &amp;quot;[[Source_Coherence_Introduction_and_Concepts#Concepts_of_Source_Coherence|''Concepts of Source Coherence'']]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For more details check the following topics:&lt;br /&gt;
* [[Source_Coherence_Introduction_and_Concepts#Layout_of_the_Source_Coherence_Window|Layout of the Source Coherence Window]]&lt;br /&gt;
* Reference (in the BESA help)&lt;br /&gt;
&lt;br /&gt;
Please also refer to our website at http://www.besa.de for the latest tutorial on source coherence and related topics.&lt;br /&gt;
&lt;br /&gt;
== Concepts of Source Coherence ==&lt;br /&gt;
&lt;br /&gt;
Recently, an increasing number of papers on oscillatory coupling between brain regions in animal studies and on time-frequency analysis of human EEG and MEG data has been published. BESA Research introduces several tools for fast and user-friendly time-frequency analysis including source and scalp coherence.&lt;br /&gt;
&lt;br /&gt;
First, let us introduce some terminology in order to clarify the concepts:&lt;br /&gt;
* Surface waveform: a time signal recorded from EEG-electrodes or MEG sensors&lt;br /&gt;
* Source waveform: a time signal calculated for a specified brain region or cortical surface&lt;br /&gt;
* Source montage: transformation of the on-going EEG into the estimated contributions or source waveforms of a set of brain regions&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (1).gif ]]&lt;br /&gt;
&lt;br /&gt;
* Time-frequency analysis: analysis or display of the event-related time-locked or induced activity in the time-frequency domain&lt;br /&gt;
* Time-locked activity: event-related signal with similar wave shape over trials&lt;br /&gt;
* Induced activity: oscillatory activity occurring in a certain event-related time window with varying time lag and phase&lt;br /&gt;
* Oscillatory activity: activity occurring with several oscillations in a narrow frequency band; can be time-locked and/or induced&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (2).gif ]]&lt;br /&gt;
&lt;br /&gt;
* TSE: temporal spectral evolution, change in amplitude or power over time relative to the baseline interval&lt;br /&gt;
* ERD/ERS: event-related (de)-synchronization, used as a synonym for TSE&lt;br /&gt;
* ERSP: event-related spectral perturbations, change in power or amplitude over time. This is the more general term and comprises ERD/ERS/TSE that are related to baseline.&lt;br /&gt;
* Correlation: correlation between two time signals, i.e. scalar product of normalized signals in time domain&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
* Spectral-temporal density function S(f,t) = A(f,t)*e&amp;lt;sup&amp;gt;i*ϕ(f,t)&amp;lt;/sup&amp;gt;: quantifies amplitude A and phase ϕ of a signal at a certain frequency f and latency t relative to an event&lt;br /&gt;
* Coherence: squared correlation of two spectral density functions S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;(f,t) and S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(f,t) over trials, i.e. squared scalar product of S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;(f,t) and S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(f,t) over trials, normalized across all trials&lt;br /&gt;
* Phase coherence: correlation of two normalized spectral density functions S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;(f,t) and S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(f,t) over trials, quantified by the phase locking value (PLV)&lt;br /&gt;
* Phase locking value (PLV): scalar product of S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;(f,t) and S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(f,t) over trials, where S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;(f,t) and S&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;(f,t) are normalized, i.e. they become unit vectors in the complex plane&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (4).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Phase coherence uses only the phase relationships between channels for the coherence estimate, not the amplitudes. The method implemented here was described by Lachaux et al. (1999). Phase coherence is described by the so-called &amp;quot;phase locking value&amp;quot; (PLV).&lt;br /&gt;
&lt;br /&gt;
Comparison of the formulae for coherence and PLV illustrates that for constant amplitudes, PLV is equivalent to the square root of coherence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scalp Coherence ===&lt;br /&gt;
&lt;br /&gt;
When coherence is calculated at the surface between 2 EEG channels or 2 MEG sensors, activity from various brain regions is picked up in each of the surface channels. Oscillatory activity in one brain region can already lead to a strong coherence between 2 surface channels because of the wide distribution of focal brain activity at the surface. This is due to the nature of the dipole fields when recording remotely and due to the smearing effect of the volume conduction in EEG. As a consequence, a coherence measure between surface channels cannot distinguish between coherence due to propagation and real coherence between the oscillatory activities in two coupled brain regions.&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
Whether true coherence can be detected at the scalp, depends mainly on the relative orientation of the source currents in the underlying brain regions and, to a lesser extent, on their distance in location. In the case of the auditory cortex, for example, both the left and right temporal planes produce vertical activity with strong bilateral contributions centrally (e.g. at C3/C4 and F3/F4). The spatial correlation of the radial activities at the lateral surfaces of the superior temporal gyrus is also very large between right and left scalp electrodes, e.g. at T3/T4. A current-source density montage (CSD or Laplacian) can reduce the effects of propagation on scalp coherence to a certain extent, because it enhances the radial current from the underlying cortex relative to more remote sources to some extent.&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Source Coherence ===&lt;br /&gt;
&lt;br /&gt;
An optimal separation is obtained by a source montage derived from a multiple source model. The model is used to create an inverse spatial filter, i.e. a source montage that separates the different brain activities. Activities that are not accounted for by the model, e.g. from background noise or EEG, are distributed amongst the sources and may therefore lead to 'noise coherence' between source channels. This 'noise coherence' can be large for sources which have very similar spatial topographies. It can be reduced by increasing the regularization constant of the inverse at the expense of a larger cross-talk between the sources or by including specific sources accounting for the 'noise'.&lt;br /&gt;
&lt;br /&gt;
The principal steps to calculate a time-frequency diagram and source coherence are illustrated in the figure below for the real data example of error-related negativity (ERN). A multiple source model is created from averaged ERP data and/or sources in brain regions known to contribute from fMRI/PET studies using a similar task. The source model is then used to calculate a source montage and the source waveforms of the single trials. Next, each single trial is transformed into the time-frequency domain by selecting a certain temporal resolution using complex demodulation (a principle similar to FM radio). From the single trials, time-frequency displays are generated by averaging spectral density amplitude or power over trials. Source coherence is calculated by averaging the cross-spectral density of one reference channel with all other channels over trials and normalizing by the averaged auto-spectral densities (cf. figure above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:SourceCoh Concepts (7).gif ]]&lt;br /&gt;
&lt;br /&gt;
In this figure, you can see the separation of the occipital alpha rhythm (top 3 source waveforms) from the frontal midline ERN components (lowest 2 traces) which become prominent in most single trials after transforming from the 128 scalp electrodes onto 9 source areas in the brain. The time-frequency display shows a strong evoked ERN activity in the anterior and posterior cingulate gyrus (CG) sources and an induced suppression and rebound of ~20 Hz activity in the sensori-motor cortex bilaterally. Alpha suppression is most prominent in the midline occipital source. A double click onto the TF display of a selected channel leads to the rapid calculation of the coherence between this channel and all other channels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For more information, see the following sections (''Layout of the Source Coherence Window'' and ''Tutorial''). --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Layout of the Source Coherence Window ==&lt;br /&gt;
&lt;br /&gt;
The source coherence window consists of&lt;br /&gt;
&lt;br /&gt;
* title bar with information on the current display mode and the data file name&lt;br /&gt;
* menu bar where the display mode and analysis options are selected&lt;br /&gt;
* toolbar for quick access to the menu functions&lt;br /&gt;
* display area where time-frequency diagrams of all channels are shown&lt;br /&gt;
* information text about the current display mode and units (e.g. Power, Amplitude, or Coherence) at the bottom left&lt;br /&gt;
* color map with minimum and maximum normalization values at the center bottom. Any value higher or lower than the normalization value is assigned the color of the normalization value&lt;br /&gt;
* information text about the condition which is analyzed at the bottom right&lt;br /&gt;
* status bar with information about the channel, frequency, latency, and signal amplitude&lt;br /&gt;
&lt;br /&gt;
[[Image:Coherence (1).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Time_Frequency_Resolution_In_BESA</id>
		<title>Time Frequency Resolution In BESA</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Time_Frequency_Resolution_In_BESA"/>
				<updated>2021-05-05T14:44:24Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic+Coherence or higher&lt;br /&gt;
|version = BESA Research 5.2 or higher&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
&lt;br /&gt;
The time-frequency resolution of the complex demodulation used in BESA depends on the user-settings for “''Frequency and Time Sampling''” in the “''Coherence''” tab of the ERP dialog box. The following table lists the 50% power and amplitude drops, respectively, as a function of the time-frequency sampling setting. Frequencies are given relative to the center frequency of a sharp frequency oscillation, latencies are given to the latency of a sharp time event.&lt;br /&gt;
For example, with a time-frequency setting of 1.0 Hz, 50 ms, a sine wave with sharp frequency f will be smoothed to a time-frequency signal that has a full power width at half maximum of 2×1.42 Hz. In other words, at frequencies f ± 1.42 Hz, the displayed power in the time-frequency plot is half of the displayed power at frequency f. A sharp time-event, (e.g. a sharp spike in the time-domain) will be smoothed to a time-frequency signal of 2×78.8 ms full power width at half maximum.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Time-Frequency Sampling&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | 50% Power Drop&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | 50 % Amplitude Drop&lt;br /&gt;
|-&lt;br /&gt;
| 0.20 Hz / 250 ms&lt;br /&gt;
| ±0.283 Hz, ±394 ms&lt;br /&gt;
| ±0.397 Hz, ±554 ms&lt;br /&gt;
|-&lt;br /&gt;
| 0.25 Hz / 200 ms&lt;br /&gt;
| ±0.354 Hz, ±315 ms&lt;br /&gt;
| ±0.496 Hz, ±443 ms&lt;br /&gt;
|-&lt;br /&gt;
| 0.5 Hz / 100 ms&lt;br /&gt;
| ±0.708 Hz, ±158 ms&lt;br /&gt;
| ±0.993 Hz, ±222 ms&lt;br /&gt;
|-&lt;br /&gt;
| 1.0 Hz / 50 ms&lt;br /&gt;
| ±1.42 Hz, ±78.8 ms&lt;br /&gt;
| ±1.99 Hz, ±111 ms&lt;br /&gt;
|-&lt;br /&gt;
| 2.0 Hz / 25 ms&lt;br /&gt;
| ±2.83 Hz, ±39.4 ms&lt;br /&gt;
| ±3.97 Hz, ±55.4 ms&lt;br /&gt;
|-&lt;br /&gt;
| 2.5 Hz / 20 ms&lt;br /&gt;
| ±3.54 Hz, ±31.5 ms&lt;br /&gt;
| ±4.96 Hz, ±44.3 ms&lt;br /&gt;
|-&lt;br /&gt;
| 5.0 Hz / 10 ms&lt;br /&gt;
| ±7.08 Hz, ±15.8 ms&lt;br /&gt;
| ±9.93 Hz, ±22.2 ms&lt;br /&gt;
|-&lt;br /&gt;
| 10.0 Hz / 5 ms&lt;br /&gt;
| ±14.2 Hz, ±7.88 ms&lt;br /&gt;
| ±19.9 Hz, ±11.1 ms&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following two plots show the frequency blurring (left) and the temporal blurring (right) for a time-frequency sampling of 2.0 Hz / 25 ms. When applying a denser frequency sampling, the frequency resolution will increase, and the time resolution will decrease proportionally (i.e. the x-axis scaling will change proportionally).&lt;br /&gt;
&lt;br /&gt;
[[File: Time_Frequency_Resolution.png]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Time-Frequency]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Averaging_Across_EEG_Datasets_from_Different_Recording_Systems</id>
		<title>Averaging Across EEG Datasets from Different Recording Systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Averaging_Across_EEG_Datasets_from_Different_Recording_Systems"/>
				<updated>2021-05-05T14:44:01Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The easiest way to create a grand average of files with differing electrode configurations is to use spatial interpolation to 81 standard positions. This will work for electrode nets with &amp;gt;81 electrodes (basically a spatial down-sampling), but it will also work for electrode nets with &amp;lt; 81 channels as BESA Research uses a spline interpolation that will calculate the signal at any position on the head surface based on the given information. Thus, it is possible to assume 81 standard electrodes distributed across the head and estimate their according signal. To use this spatial interpolation, do the following:&lt;br /&gt;
* In the Combine Conditions dialog ''&amp;quot;ERP &amp;amp;rarr; Combine Conditions…&amp;quot;'' simply load all the individual average files you want to grand-average, no matter how many electrodes they contain&lt;br /&gt;
* In the second tab ''&amp;quot;Condition List&amp;quot;'' define your conditions as usual&lt;br /&gt;
* Leave the third tab ''&amp;quot;Channel List&amp;quot;'' untouched&lt;br /&gt;
* In the fourth tab ''&amp;quot;Run Script&amp;quot;'' the option ''&amp;quot;Interpolate to standard 81 electrodes&amp;quot;'' will be automatically checked. Make sure that the setting ''&amp;quot;combine data from source files&amp;quot;'' is also checked if you want to create a grand average.&lt;br /&gt;
* Press OK to start averaging.&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Averaging_Across_EEG_Datasets_from_Different_Recording_Systems</id>
		<title>Averaging Across EEG Datasets from Different Recording Systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Averaging_Across_EEG_Datasets_from_Different_Recording_Systems"/>
				<updated>2021-05-05T14:42:18Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The easiest way to create a grand average of files with differing electrode configurations is to use spatial interpolation to 81 standard positions. This will work for electrode nets with &amp;gt;81 electrodes (basically a spatial down-sampling), but it will also work for electrode nets with &amp;lt; 81 channels as BESA Research uses a spline interpolation that will calculate the signal at any position on the head surface based on the given information. Thus, it is possible to assume 81 standard electrodes distributed across the head and estimate their according signal. To use this spatial interpolation, do the following:&lt;br /&gt;
* In the Combine Conditions dialog ''&amp;quot;ERP &amp;amp;rarr; Combine Conditions…&amp;quot;'' simply load all the individual average files you want to grand-average, no matter how many electrodes they contain&lt;br /&gt;
* In the second tab ''&amp;quot;Condition List&amp;quot;'' define your conditions as usual&lt;br /&gt;
* Leave the third tab ''&amp;quot;Channel List&amp;quot;'' untouched&lt;br /&gt;
* In the fourth tab ''&amp;quot;Run Script&amp;quot;'' the option ''&amp;quot;Interpolate to standard 81 electrodes&amp;quot;'' will be automatically checked. Make sure that the setting ''&amp;quot;combine data from source files&amp;quot;'' is also checked if you want to create a grand average.&lt;br /&gt;
* Press OK to start averaging.&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Anonymizer</id>
		<title>BESA Anonymizer</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Anonymizer"/>
				<updated>2021-05-05T14:41:53Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research &lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Anonymizing EEG data ==&lt;br /&gt;
The BESA Anonymizer is a simple tool which allows you to anonymize EEG data sets that you would like to share for research purposes. You can anonymize single files, or all EEG files in a folder. Several EEG file formats are supported. &lt;br /&gt;
&lt;br /&gt;
BESA Anonymizer comes as a free tool which is part of the installation package of BESA Research. You can start it simply by clicking the Windows Start button – the Anonymizer is part of the BESA program group.&lt;br /&gt;
&lt;br /&gt;
[[File:BESAAnonymizer.png|none]]&lt;br /&gt;
 &lt;br /&gt;
== Anonymizing MRI data ==&lt;br /&gt;
MRI data sets can be anonymized directly in BESA MRI at the time of loading the data into the project. This workflow has also been improved in the March release of BESA MRI 2.0.&lt;br /&gt;
Note that this anonymization only affects BESA MRI projects including the data inside them. The original DICOM files remain unchanged. However, BESA MRI projects can be shared easily, without a need for incorporating the original MRI data.&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_files_extensions</id>
		<title>BESA files extensions</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_files_extensions"/>
				<updated>2021-05-05T14:08:12Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
One of the most important rules in BESA software is that the original data will never be changed during data processing (unless the user explicitly wants to do it by himself). All changes (e.g. signal processing like filtering) performed in BESA are kept in PC memory and not saved in the file. That type of approach has a drawback since all settings have to be re-generated whenever the data file is reopened. Therefore to keep all settings and be able to reload them whenever a file will be opened, BESA saves additional files beside the original one (with the same base name, but different file extensions). Note that this approach has one additional advantage: whenever the user wants to start analysis from scratch he or she just needs to delete the files responsible for a particular setting (or all files to get back to the initial state). Therefore a good understanding of BESA file nomenclature may be useful for advanced BESA users.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Besa Research file extensions==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 7%; | Application &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 7%; | File extension &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 25%; class=&amp;quot;unsortable&amp;quot; | File function &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 40%; class=&amp;quot;unsortable&amp;quot; | When generated/changed &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 20%; class=&amp;quot;unsortable&amp;quot; | Wiki page&lt;br /&gt;
|-&lt;br /&gt;
| Main || .atf || Artifact coefficients  || After setting up artifact correction (right mouse click, ''&amp;quot;Define artifact topography&amp;quot;'' menu) || [[Handling Artifacts in BESA]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .bad || Bad channels || Whenever electrode is marked as bad or is interpolated|| [[Review]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .cot || Head center coordinate || External file loaded to BESA. Information about file localization on disk is saved in .fst file|| [[Working_With_Additional_Files#cot_.28Head_center.29_file | Working With Additional Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .ela, .elp, .eps || Additional electrode configuration files || When electrodes configuration was loaded (''&amp;quot;File &amp;amp;rarr; Load Channel Configuration&amp;quot;''). *.elp file can be manually saved in ''&amp;quot;File &amp;amp;rarr; Head Surface Points and Sensors &amp;amp;rarr; Save Electrode File for Current Montatage&amp;quot;''|| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;[[Electrodes and Surface Locations]]&amp;lt;/li&amp;gt; &amp;lt;li&amp;gt;[[Channel Definition File Formats]]&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Main || .evt || Events || External text file. Can be loaded by selecting ''&amp;quot;ERP &amp;amp;rarr; open event file…&amp;quot;'' (and saved by ''&amp;quot;ERP &amp;amp;rarr; save event file…&amp;quot;''). After loading information is copied to .ftg and also .fst file is updated. || [[Event File Format]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .fst || General setup file || When data file is opened for a first time, updated whenever various settings are changed (i.e. filtration parameters, surface point file localization) ||&lt;br /&gt;
|-&lt;br /&gt;
| Main || .ftg || Triggers || On file close ||&lt;br /&gt;
|-&lt;br /&gt;
| Main || .ica || ICA topography || Can be saved after ICA analysis by clicking right mouse button on desired component name and selecting ''&amp;quot;Save Topography&amp;quot;'' || [[BESA Research ICA]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .mtg || Montages || If montage was changed, just .fst file is updated. Mtg files are kept in &amp;quot;C:\Users\Public\Documents\BESA\Research_6_1\Montages&amp;quot; || [[BESA Research Montage Editor]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .sel|| Additional Channel Montages || In Montage Editor window, menu &amp;quot;File → Save Montage As...&amp;quot; → Change 'Save as type' to 'Additional Channel Montages (*.sel)' || [[BESA_Research_Montage_Editor#Saving_Additional_Channel_Montages | Saving Additional Channel Montages]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .pdg || Paradigm || After loading or creating the paradigm || [[Paradigm File Format in BESA]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .pmg || MEG magnetometer sensors coordinates || External file loaded to BESA. Information about file localization is saved in .fst file || [[MEG Sensor Coordinate Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .pos || MEG gradiometer sensors coordinates || External file loaded to BESA. Information about file localization is saved in .fst file || [[MEG Sensor Coordinate Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .sfh || Coregistration info || Created when coregistration with MRI is started (''&amp;quot;File &amp;amp;rarr; MRI Coregistration..&amp;quot;''). Can be loaded externally, then information about file localization is saved in .fst file || [[Integration with MRI and fMRI]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .sfn || Labels assigned to electrode configuration .eps || External file loaded to BESA. Information about file localization saved in .fst file || [[Electrodes and Surface Locations]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .sfp || Digitized head surface points coordinates || External file loaded to BESA. Information about file localization saved in .fst file || [[Electrodes and Surface Locations]]&lt;br /&gt;
|-&lt;br /&gt;
| Main || .tal || Talairach coordinates || External file loaded to BESA. || &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;[[Integration with MRI and fMRI]]&amp;lt;/li&amp;gt; &amp;lt;li&amp;gt;[[Talairach Transformation File#AC-PC to Talairach|AC-PC to Talairach]]&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Export || .avr || ASCII vectorized data file || Can be generated by ''&amp;quot;File &amp;amp;rarr; Export…&amp;quot;'' || [[Working_With_Additional_Files#ASCII_vectorized_format_.28.2A.avr.29 | Working With Additional Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Export || .dat || Simple binary matrix with data || Can be generated by ''&amp;quot;File &amp;amp;rarr; Export…&amp;quot;'' || [[Working With Additional Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Export || .edf || EDF+ (European Data Format) data file || Can be generated by ''&amp;quot;File &amp;amp;rarr; Export…&amp;quot;'' || [[Working With Additional Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Export || .foc || BESA continuous native data file || Can be generated by ''&amp;quot;File &amp;amp;rarr; Export…&amp;quot;'' || [[Working_With_Additional_Files#Binary_format_.28.2A.foc.2C_.2A.fsg.29 | Working With Additional Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Export || .fsg || BESA averaged native data file || Can be generated by ''&amp;quot;File &amp;amp;rarr; Export…&amp;quot;'' || [[Working_With_Additional_Files#Binary_format_.28.2A.foc.2C_.2A.fsg.29 | Working With Additional Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Export || .generic || Additional header file for binary data (.dat) || File automatically created when binary data file was exported. This file is needed to reopen .dat file || [[Working_With_Additional_Files#Generic_File_Format | Working With Additional Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Export || .mul || ASCII multiplexed data file || Can be generated by ''&amp;quot;File &amp;amp;rarr; Export…&amp;quot;'' || &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;[[ASCII File Format]]&amp;lt;/li&amp;gt; &amp;lt;li&amp;gt;[[Working_With_Additional_Files#ASCII_Multiplexed_format_.28.2A.mul.29 | Working With Additional Files]]&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Export || 0.001, 0.002 … || ASCII vectorized or multiplexed epochs around triggers || Can be generated by ''&amp;quot;File &amp;amp;rarr; Export…&amp;quot;'' File extension indicates epoch number || &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;[[ASCII File Format]]&amp;lt;/li&amp;gt; &amp;lt;li&amp;gt;[[Working With Additional Files]]&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Export || .stddev || ASCII standard deviations of data points in .fsg files || Can be generated by ''&amp;quot;File &amp;amp;rarr; Export…&amp;quot;''  || [[Export#Type_of_data_to_export|Type of data to export]] &lt;br /&gt;
|-&lt;br /&gt;
| Top Viewer || .bmp || bitmap file  || Save of current state of Top Viewer window (''&amp;quot;File &amp;amp;rarr; Save as Bitmap...&amp;quot;'') || [[Advanced Top Viewer Features]]&lt;br /&gt;
|-&lt;br /&gt;
| Top Viewer || .eps || EPS graphic file || Save of current state of Top Viewer window (''&amp;quot;File &amp;amp;rarr; Save as eps file...&amp;quot;'') || [[Advanced Top Viewer Features]]&lt;br /&gt;
|-&lt;br /&gt;
| Top Viewer || .tva || Top viewer arrangement || On Top Viewer window close, only if settings or electrode position was changed || [[Advanced Top Viewer Features]]&lt;br /&gt;
|-&lt;br /&gt;
| Top Viewer || .tvs || Top Viewer settings || On Top Viewer window close, only if settings or electrode position was changed || [[Advanced Top Viewer Features]]&lt;br /&gt;
|-&lt;br /&gt;
| Time Frequency Analysis || .tfc || Averaged time-frequency data || Can be created when Time-Frequency Analysis is used (''&amp;quot;ERP &amp;amp;rarr; coherence tab&amp;quot;'') || [[Source Coherence Introduction and Concepts]]&lt;br /&gt;
|-&lt;br /&gt;
| Time Frequency Analysis || .tfcs || Single trial time-frequency data || Can be created when Time-Frequency Analysis is used (''&amp;quot;ERP &amp;amp;rarr; coherence tab&amp;quot;'') || [[Source Coherence Introduction and Concepts]]&lt;br /&gt;
|-&lt;br /&gt;
| Source Analysis || .bmp || bitmap file  || Save of current state of 3D window (''&amp;quot;File &amp;amp;rarr; Save 3D window as a bitmap...&amp;quot;'') || [[Source Analysis 3D Imaging]]&lt;br /&gt;
|-&lt;br /&gt;
| Source Analysis || .bsa || Source analysis solution (i.e. dipoles) || Can be loaded or saved in menu of source analysis window (''&amp;quot;File &amp;amp;rarr; Save Solution..&amp;quot;'') || [[Source Analysis Introduction]]&lt;br /&gt;
|-&lt;br /&gt;
| Source Analysis || .dat || 3D Image ASCII file or voxel values for each dipole orientation || Can be exported in 3D window of Source Analysis (''&amp;quot;Image &amp;amp;rarr; Export Image as…&amp;quot;'') if sources for more than one latency was computed you can select option to save voxel values for each dipole orientation || [[Source Analysis 3D Imaging]]&lt;br /&gt;
|-&lt;br /&gt;
| Source Analysis || .hdr || 3D Image ANALYZE file || Can be exported in 3D window of Source Analysis (''&amp;quot;Image &amp;amp;rarr; Export Image as…&amp;quot;'') if sources for more than one latency was computed you can also choose option to save data for all latencies || [[Source Analysis 3D Imaging]]&lt;br /&gt;
|-&lt;br /&gt;
| Source Analysis || .laura || Result file of LAURA || After computation of LAURA in Source Analysis || [[Source Analysis 3D Imaging]]&lt;br /&gt;
|-&lt;br /&gt;
| Source Analysis || .loreta || Result file of LORETA || After computation of LORETA in Source Analysis || [[Source Analysis 3D Imaging]]&lt;br /&gt;
|-&lt;br /&gt;
| Source Analysis || .swf || Source waveforms || Can be saved in file menu of source analysis window (''&amp;quot;File &amp;amp;rarr; Save Source Waveforms...&amp;quot;'') || [[Export Dipole Moments of Fitted Sources]]&lt;br /&gt;
|-&lt;br /&gt;
| Source Analysis || .vmp || 3D Image BrainVoyager File (can be written with current resolution or with 1 mm) || Can be exported in 3D window of Source Analysis (''&amp;quot;Image &amp;amp;rarr; Export Image as…&amp;quot;'') || [[Source Analysis 3D Imaging]]&lt;br /&gt;
|-&lt;br /&gt;
| Source Analysis || .vtc || BrainVoyager VTC File for all latencies || If sources for more than one latency was computed it can be exported in 3D window of Source Analysis (''&amp;quot;Image &amp;amp;rarr; Export Image as…&amp;quot;'')  || [[Source Analysis 3D Imaging]]&lt;br /&gt;
|-&lt;br /&gt;
| Source Analysis || .vts || Image ASCII voxel time series || If sources for more than one latency was computed it can be exported in 3D window of Source Analysis (''&amp;quot;Image &amp;amp;rarr; Export Image as…&amp;quot;'') || [[Source Analysis 3D Imaging]]&lt;br /&gt;
|-&lt;br /&gt;
| FFT || .faa, .fap, .far, .fai || Exported amplitude (fma), power (fmp), real (fmr) and imaginary part (fmi) of signal spectrum for average reference (Interpolated-81) montage || One of the export options in FFT window ''&amp;quot;File &amp;amp;rarr; Export FFT data menu&amp;quot;'' with ''&amp;quot;Interpolated-81&amp;quot;''  menu item selected (in the same menu) || [[BESA Research Spectral Analysis]]&lt;br /&gt;
|-&lt;br /&gt;
| FFT || .fba || Exported Amplitude in Bands || In FFT window menu ''&amp;quot;File &amp;amp;rarr; Export Amplitude in Bands&amp;quot;''|| [[BESA Research Spectral Analysis]]&lt;br /&gt;
|-&lt;br /&gt;
| FFT || .fbp || Exported Power in Bands || In FFT window menu ''&amp;quot;File &amp;amp;rarr; Export Power in Bands&amp;quot;''|| [[BESA Research Spectral Analysis]]&lt;br /&gt;
|-&lt;br /&gt;
| FFT || .fft || result of FFT || In FFT window ''&amp;quot;File &amp;amp;rarr; save…&amp;quot;''|| [[BESA Research Spectral Analysis]]&lt;br /&gt;
|-&lt;br /&gt;
| FFT || .fma, .fmp, .fmr, .fmi || Exported amplitude (fma), power (fmp), real (fmr) and imaginary part (fmi) of spectrum for current montage || One of export options in FFT window ''&amp;quot;File &amp;amp;rarr; Export FFT data&amp;quot;'' menu with ''&amp;quot;Current montage&amp;quot;'' menu item selected (in the same menu)|| [[BESA Research Spectral Analysis]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Batch_Processing</id>
		<title>Batch Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Batch_Processing"/>
				<updated>2021-05-05T14:02:39Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 5.2 or higher&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== BESA batches allow you to automate nearly all analysis steps in BESA ==&lt;br /&gt;
The batch functionality that you find under the “Process” menu has been around for a while. Over the past few years, the toolkit that is available there has grown to an impressive size, such that with BESA Research 6.0, virtually all analysis steps can be automated, and applied to a list of files. At any point in time, the batch can also be halted to make parameter adjustments, should this be necessary. A complete analysis from pre-filtering, artifact scanning, averaging, source analysis, and export of results for subsequent statistical analysis, can be summarized in few steps. For many recurring tasks, ready-made batches are available already – and batches can also be assigned to function keys for maximum ease of use. &lt;br /&gt;
&lt;br /&gt;
The set of available commands is shown below – sub-divided into &lt;br /&gt;
*general commands which allow e.g. loops, error handling, or pausing the batch for user input&lt;br /&gt;
*commands affecting the main program including ERP management&lt;br /&gt;
*commands for discrete source analysis&lt;br /&gt;
*commands for distributed source analysis&lt;br /&gt;
*time-frequency commands&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BatchMenu.jpg|none|left]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, to automate averaging and to prepare data for statistical analysis, using an experimental paradigm for a number of subjects, a batch could have the following elements:&lt;br /&gt;
*Load the paradigm&lt;br /&gt;
*Perform an artifact scan &lt;br /&gt;
*Average the conditions&lt;br /&gt;
*Export the data of each condition for further analysis with BESA Statistics&lt;br /&gt;
&lt;br /&gt;
In batch code, this will look like the following:&lt;br /&gt;
&lt;br /&gt;
[[File:BatchExample.png|none|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add any command, e.g. “Average”, select the command from the list of commands and check the options dialog that appears:&lt;br /&gt;
&lt;br /&gt;
[[File:BatchExampleAv.png|700px|none|left]]&lt;br /&gt;
&lt;br /&gt;
Left side: First click the &amp;quot;Add Command&amp;quot; button. Then select a command from the list. Right side: After selecting, a dialog opens where command options can be defined.&lt;br /&gt;
&lt;br /&gt;
Once the batch is complete, it can run over all open files, over a user-defined file list (simply drag files into the list from Explorer), or just over the current file. Note that these batches are produced without entering any line of code by hand – it is all done using the graphical user interface of the Batch dialog.&lt;br /&gt;
&lt;br /&gt;
== An example batch for Averaging step by step ==&lt;br /&gt;
The first two commands will load the paradigm file and perform the artifact scan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Paradigm(%Scripts%\Paradigm\Auditory\AEP_Intensity.PDG)&lt;br /&gt;
ArtifactScan(Wait)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BatchArtScan.png|500px|none|left]] &lt;br /&gt;
&lt;br /&gt;
The next command will average over the conditions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Average(%basename%_av, %Examples%\ERP-Auditory-Intensity\Averages\, NoDefaultName,OverwriteTarget, NoCorrect)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:BatchExampleAv2.png|500px|none|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next commands will loop over the first 5 segments (condition averages) and export them to different ASCII files to be used in further processing in BESA Statistics or other programs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAINFileOpen(%Examples%\ERP-Auditory-Intensity\Averages\%basename%_av.fsg)&lt;br /&gt;
GENFor(segm, 1, 5, 1, 1)&lt;br /&gt;
MAINMarkBlock(WholeSegment,-,%segm%)&lt;br /&gt;
MAINExport(%basename%-export%segm%, \, Segment, ASCvec, Original, FiltOff, NoResample, Replace, -, )&lt;br /&gt;
GENEndFor()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:BatchExampleAv3.png|500px|none|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Of course, many more options are available – check it out! For example, segments can automatically be sent to Source Analysis to perform automated imaging and export these results for further analysis, too. &lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Mapping</id>
		<title>BESA Research Mapping</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Mapping"/>
				<updated>2021-05-05T13:39:22Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Mapping&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== Mapping Window ===&lt;br /&gt;
&lt;br /&gt;
The 3D mapping window displays whole-head 3D maps that reflect the voltage topography of the ongoing EEG using the current filter settings. The mapping procedure interpolates the EEG voltage or current source density (CSD) values over the whole head on the basis of the spherical splines method with moderate smoothing (Perrin et al. 1989). Maps are projected onto a 3D standardized head surface for a more realistic display of the voltage topography. The head surface was generated by averaging the MRI images of 50 normal subjects after transformation into Talairach space.&lt;br /&gt;
&lt;br /&gt;
A single 3D map is displayed automatically at the detection peak of a clustered event when selecting an event or cluster in the cluster or hyper cluster displays. The single 3D map is rotated automatically to set the viewpoint to the center of gravity in the map to provide for immediate optimal inspection of dipolar topography. To adjust the viewpoint for a more detailed inspection, use the standard rotation buttons introduced below or use the mouse drag over the head.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (1).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''2D (left) and 3D (right) voltage maps in single head view at one time point. The EEG shows a detected event in the Av33 user-defined montage.''&lt;br /&gt;
&lt;br /&gt;
The mapping window appears also when a cursor is set in the EEG data display by clicking onto the EEG.&lt;br /&gt;
&lt;br /&gt;
The mapping window can appear in four different layouts: Single map, 6 maps in standard view, 15 serial maps, or customized series of maps. For details on 3D maps see the section ''&amp;quot;3D Maps&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
=== 3D Maps ===&lt;br /&gt;
&lt;br /&gt;
'''Introduction'''&lt;br /&gt;
&lt;br /&gt;
Maps are projected onto a 3D standardized head surface for a more realistic display of voltage topography. The head surface was generated by averaging the MRI images of 24 normal subjects after transformation to the Talairach space using the BrainVoyagerTM software. The standard 10-10 electrodes were adjusted to each individual head using the nasion, pre-auricular points (T9, T10), the inion and the eye canthii as landmarks. Using the spherical spline interpolation over the whole head, reference-free maps are calculated.&lt;br /&gt;
&lt;br /&gt;
'''Controls'''&lt;br /&gt;
&lt;br /&gt;
Use the mouse and the keyboard as follows:&lt;br /&gt;
&lt;br /&gt;
* Click on a map in the standard whole head view with 6 preset viewpoints to display 15 serial maps in the selected view.&lt;br /&gt;
* Click on a serial map to select a specific time for the display of the 6 standard whole-head maps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (1).png ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''3D whole head maps at one latency using 6 standard viewpoints (left) and at a sequence of 15 latencies in serial view (right)''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Double-click on a standard or serial map to obtain a single enlarged map.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Drag over the head to rotate or use standard rotation buttons (for more details see below).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Click or double click on the single head to obtain the 15 serial maps.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Click on the EEG-Voltage label (bottom left) to display CSD maps. Click on the EEG-C.S.D. label which appears to redisplay voltage maps,&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;or type&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''''' M'''''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''''V'''''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for voltage maps and &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''''C'''''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for CSD maps.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;When you move the mouse pointer over an electrode, the electrode label (and voltage if in voltage mode) is displayed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Left and right cursor keys plot new maps one time unit before or after the current time point. The time units can be adjusted using the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Timing Interval'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; toolbar button.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; [[Image:Mapping (4).gif ]]&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Up and down cursor keys raise or lower the scaling units of the map display. 3 steps change the scaling by a factor of 2.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;In the sequential and single map views, the head can be rotated, zoomed, or moved, by clicking and dragging with the mouse, depending on which of the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D Rotate'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Magnify'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D Move'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; buttons in the toolbar has been depressed (see below). In addition, the three mouse dragging functions can be controlled directly by holding down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Shift'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;,&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl+Shift'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; keys:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.259cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Shift-Drag'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;: Rotate&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.259cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl-Drag'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;: Move&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.259cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Shift+Ctrl-Drag'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;: Magnify/Zoom&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Hit the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Escape '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;key to close the map window.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#00000a;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toolbar'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The toolbar offers a convenient way to modify the mapping display. The buttons are grouped as follows:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D Rotate'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D Magnify'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, and &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D Move '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;buttons select what happens when you click and drag with the mouse on a map:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Maps can be rotated (left button pressed), zoomed (middle button pressed), or moved (right button pressed).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The buttons are only enabled when 3D maps series or single heads are displayed. They are grayed in the standard 6-head view.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (7).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D Fast Rotation'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; buttons rotate maps in steps of 45°, to the left (left button pressed), to the right (middle button pressed), or vertically (right button pressed).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The buttons are only enabled when maps series or single heads are displayed. They are grayed in the standard 6-head view.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (8).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;These buttons control mapping layout and options.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The left button, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Seq-Std Display'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, toggles between the standard 6-head view (6 maps from different viewpoints) and the standard sequential top view display with 15 serial maps.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The middle button, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Serial Arrangement'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, opens a dropdown menu that allows for selection of either 5 x 7, 5 x 3 serial maps, a single map (1 x 1), or a custom array of serial maps:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (9).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The right button, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, opens the Options popup menu that allows for general settings of the maps:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (10).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Toggle between 3D or 2D mapping&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Toggle between whole head mapping and top meridian projection&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Toggle between voltage and CSD display&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Toggle between serial and standard maps&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Toggle whether maps cover the entire head or are cut off at the lower part of the head&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Toggle display of electrodes on the maps&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Open the online Help&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (11).gif ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;These buttons control the timing of maps: Pressing the left button, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Timing Left'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, generates maps one time unit earlier than the current map. Pressing the middle button, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Timing Right'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, generates maps one time unit later than the current map. In serial maps, clicking on the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Timing Left/Right'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; buttons in the toolbar moves the center latency to the first or last latency displayed, i.e. by 7 intervals in the standard 15 serial view.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Pressing the right button, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Timing Interval'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, opens a dropdown menu, allowing for the definition of the time interval between sequential maps or the frequency spacing between FFT maps. Voltages and CSD are interpolated to allow for the following standard and custom interval settings:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (12).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (13).gif ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The final two buttons, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Scaling'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, raise (left) or lower (right) the scaling of the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;maps. 3 steps change the scaling by a factor of 2.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Right Click Popup Menu'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;A right click on the voltage or CSD maps displays the Options popup menu that allows for general settings of the maps:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (10).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;A right click on FFT maps displays the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;popup menu with specific settings for FFT and phase maps:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (14).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;2D Maps&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;2D Maps are generated by &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''spherical spline interpolation'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; and are projected onto a spherical head outline. The display shows contour lines. Red contour lines denote positive voltage, whereas blue contour lines stand for negative voltage. In addition, areas of negative voltage are denoted by a dotted pattern.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The user interaction in 2D maps is essentially the same as in 3D maps. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Only the differences are listed here:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# [[Image:Mapping (7).gif ]]  &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;In sequential time view, dragging with the left mouse button over the heads rotates them by 90 degrees. The same is achieved using the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''standard rotation'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; toolbar buttons &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The buttons &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D Rotate'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D Magnify'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D Move'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, are disabled in 2D maps.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;A top meridian projection of the heads can be selected either using the options menu (available from the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; toolbar button), or by right click with the mouse onto a map. Top meridian projected maps are cut off at a theta value of 110°.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The 2D maps use equipotential line mapping instead of color maps to avoid bias due to the selection of the color scale and in order to emphasize the shape of the voltage or CSD distribution rather than peak areas. The noise in the EEG tends to produce arbitrary shapes in the maps around zero. Therefore, we have spaced the equipotential lines symmetrically around zero at levels of ±1/2, ±3/2, ±5/2....., and shaded negativities below -1/2 of the scaling between lines. This produces maps that are less biased by EEG noise, especially when larger scales are used. In 3D maps, an additional color shading is shown for each of the potential compartments.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;A minimum of 12 scalp channels is required to calculate the spline maps. However, a larger array of electrodes is recommended, including electrodes at inferior lateral sites (see help chapter &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''&amp;quot;Special Topics / Working with Electrodes... / Electrodes / Recommendations for Electrode Placement&amp;quot;''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Mapping of the FFT&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;FFT spectra can be mapped in a similar way as the voltage maps of the ongoing EEG. The maps are initiated from the FFT window (see the chapter &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''&amp;quot;Spectral Analysis / FFT&amp;quot;''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for more information on FFT analysis).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The results can be shown in three different ways, which are described in detail below:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;FFT maps of amplitude or power showing the topography at a single frequency&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;FFT maps of amplitude or power showing the mean over a preset frequency band&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Phase maps showing the voltage amplitude topography at a selected frequency and at a specific or different phase angles. Serial phase maps are encoded to show phase delay (in ms) for better comparison with EEG voltage maps, since phase shift is proportional to time delay. Phase maps are only available if the FFT was computed over a single data block.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#00000a;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The type of map and further mapping options can be selected from the menus &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Map'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; and &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options/Mapping'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; in the FFT window.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Mapping (15).gif ]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Map menu of the FFT window''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Note: Mapping of FFT spectra is only possible if there are at least 12 electrodes!&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Topographies at a given frequency and at a series of frequencies'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The topography of the amplitude/power at any frequency can be viewed by clicking (single or double click) on an FFT spectral plot at that frequency. As with the voltage/source maps, maps are then plotted on the right of the screen.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (16).gif ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''3D amplitude maps at a single frequency (left) and at a sequence of frequencies (right) ''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''for one viewing angle''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Analogous to voltage maps, clicking on a map will toggle between views from six sides of the head at one frequency (as above left), and a display showing a series of maps at 15 consecutive frequencies in one view (as above right). In the serial view, click on the left/right arrows in the toolbar to page 7 frequencies backward or forward. Pressing the arrow keys on the keyboard pages only one frequency.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The frequency spacing between consecutive maps can be adjusted using the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;[[Image:Mapping (4).gif ]]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; symbol on the toolbar. Clicking on the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Timing Left/Right '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;buttons in the toolbar shifts the consecutive frequency maps analogous to the serial voltage maps.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Topography at the peak frequency'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;In the FFT window, double click on the peak amplitude or click on the peak frequency value at the right of the FFT spectrum of a prominent channel to view the topography of the peak (dominant) frequency. For bad channels mapping of the peak frequency is disabled.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Topography of a frequency band'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;To view the topography of the amplitude/ power density within a given frequency band from 6 different views, select the band in the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Map'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; menu (for example, to view maps of the theta band, press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Alt+M T'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; on the keyboard). To view the topography of the summed amplitude/power over the total frequency range, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;select the menu item &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Map/Total'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;. Click on one of the maps to view maps of each frequency band in one head view, together with a map showing the mean over the total frequency range.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If a frequency band is grayed out, its upper or lower limit is out of range for the current FFT. Use the item &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Band Name'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; and &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Width'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; in the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;menu of the FFT window to redefine frequency band settings.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Phase maps at a given frequency'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Frequency maps visualize the frequency specific distribution of absolute amplitude or power over the scalp. However, these maps do not reveal phase lags caused by multiple underlying processes. Therefore, a series of spherical spline maps (phase maps) is calculated at successive phase angles &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;α&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, according to&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;H(f, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;α&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;) = cos(&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;α&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;) Re(f) + sin(&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;α&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;) Im(f)&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;where Re(f) and Im(f) are the real and imaginary voltage amplitude topographies at frequency f over the marked block which was transformed by FFT.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;A &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''change of topography'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; in consecutive maps indicates &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''multiple underlying processes'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;. Only if there is &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''no change'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; in topography with phase, a &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''single generator process'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; may be assumed. The phase shifts can directly be translated into time lags between the different topographies that are displayed in the phase maps.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;To view phase maps at a specific frequency, double click on the FFT signals or click on the peak amplitude value to generate amplitude or power maps at the selected frequency in the standard 6-head view. Then right click onto the map with the best viewpoint to obtain the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;popup menu for FFT maps:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (14).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Select &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Switch to Phase Mapping''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to obtain a series of 15 serial phase maps in 5 ms intervals. Changes to this interval and other mapping options are described above in section &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''&amp;quot;3D Maps&amp;quot;.''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; Clicking on the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Timing'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Left/Right'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; buttons in the toolbar shifts the phase similar to the serial voltage and consecutive frequency maps.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Phase maps can also be initiated from the FFT window using the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Map'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; menu.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (17).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''3D phase maps: This sequence shows a change in topography, indicating that more than one process generates the EEG signals.''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Phase maps cannot be generated for mean spectra: generating means over frequencies or over a set of FFTs causes phase information to be lost. Thus, phase maps cannot be shown for frequency bands or for the result of mean FFTs between markers.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggling between EEG/MEG FFT maps'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;For a combined EEG and MEG measurement, the type of map (either EEG or MEG) that is currently selected is displayed in the left upper corner of the FFT window. Initially EEG is displayed. Click on the text to toggle between EEG and MEG FFT maps. A currently open map window will be updated immediately.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Source Images&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Source images show the activation of brain regions which are represented by individual channels in source montages (for more information on source montages, see the chapter &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''&amp;quot;Review / Remontaging&amp;quot;''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;To start a source image, first set a cursor on the pattern of interest by double clicking with the mouse. Use the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''IMG '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;push button in the control ribbon or hit the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''I''''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key on the keyboard to display a source image.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (18).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;When a cursor is set in the waveforms display, you can toggle between voltage maps and source images by pressing or releasing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''IMG'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button. Note that the montage switches automatically to a source &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;montage when the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''IMG'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button is pressed. The last active source montage is displayed. If no source montage has been specified for the current EEG data set, the montage &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''TR_Temporal Region''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; is used.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;For each dipole channel in the current montage, the activation is shown inside the approximate brain region which is modeled by the dipole source. Regional sources are not included in the image. As in maps, it is possible to toggle between six different views at one latency, and a sequence of 15 images. The activation is shown in 7 shades. The amplitude range is measured in nAm, since the current flow inside the brain is depicted.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Using the arrow buttons at the top, you can change the latency range which is displayed, and the interval between subsequent maps:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Left group of arrow buttons: These buttons jump 7 maps forward (or backward) in time (i.e. the last (or first) map in the sequence becomes the central map.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Right group of arrow buttons: These buttons increase (or decrease) the interval between the maps in the sequence &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Using the arrow buttons at the bottom, you can adjust the scaling of the source images. They change the amplitude range of the individual shades. The amplitude range between minimum and maximum color is shown at the bottom. In the example below, it is 0 ... 158 nAm.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (19).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Images of brain activation during spike propagation in the left temporal lobe from the basal (-20 ms) to the polar (-5 ms) and antero-lateral aspects (0 ms). Each dipole source in the source montage is represented by an ellipsoid which covers the approximate volume modeled by the source. As in maps, different views at the same latency, or a sequence of maps in one view can be shown.''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Spherical Spline Maps&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Why use spherical spline interpolation?''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Spherical spline maps present an interpolation of the potential distribution at the scalp with zero integral over the whole head and maximum smoothness (Pascual et al. 1988; Pernier et al. 1989). Based on these assumptions, the spherical spline method provides an optimal interpolation within the area covered by electrodes on the scalp as well as an optimal extrapolation to the part of the sphere not covered by electrodes. The strength of the spherical spline method stems from the underlying physical boundary&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;condition: The voltages at the lower part must sum with those at the upper part to zero. Provided that the electrode coordinates are appropriately assigned to equivalent locations on a sphere, maximum smoothness is achieved by the intrinsic properties of splines which can be compared to bending an elastic bar around multiple supporting poles:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (20).gif ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Comparison of the effects of spherical splines (left) and linear interpolation (right).''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The spherical spline method allows to interpolate and integrate the scalp voltage differences across the entire sphere or whole head. Therefore, it can be used to provide a reference free estimate of the scalp voltages (Rfr-montage), and an estimate of the mean voltage at the ears (Ears-montage). We have compared the spherical spline maps with voltage maps generated by simulated dipole fields due to sources within a multi-shell spherical head model. Even with a small number of scalp electrodes located at the upper half of the head, a very accurate estimate of the reference signal can be obtained. In the worst case of vertical dipole fields (compare example &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''eeg2.eeg'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;) the negative peak at the lower half of the head could be estimated with fair accuracy.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Traditional mapping and source derivations are based on interpolation of the voltages at selected nearby electrodes. This causes problems at electrodes at the boundary of the array and discontinuities within the electrode array. Further, if a voltage maximum lies between electrodes it will not be recognized. In contrast, the spherical spline method provides a maximally smooth interpolation between all electrodes and is capable of extrapolating voltage maxima within and outside of the electrode array. Intrinsically, the spherical splines also provide the optimal estimation of current source density (CSD) which reflects the current flow out of the brain through the skull.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;BESA uses an implementation of the spherical splines method as described in the publication 'Spherical splines for scalp potential and current density mapping' by Perrin et al. (Electroencephalogr. Clin. Neurophysiol. 72:184-187, 1989). BESA uses 4th order spherical splines, including Legendre polynomials up to 50th degree. The smoothing constant l can be specified from the menu entry &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options / Mapping / Spline Interpolation Smoothing Constant.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Current Source Density (CSD)&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''What is Current Source Density (CSD)?''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''The surface Laplacian operator '''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;(second spatial derivative of the voltage distribution in tissue) calculates the volume current flow out of the brain through the skull into the skin. That is why we use the term &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Current Source Density '''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;(CSD). The CSD montage will show a large signal if the cortical surface (convexity) is active. This corresponds to a radial superficial dipole.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If the brain activity is in a fissure (tangential dipole) the CSD signal is much weaker. The current flow in a tangential direction, so you will see two peaks of opposite polarity in the CSD maps, corresponding to where the volume current is leaving (+) and entering (-) the skull. The two zones of maximum current are closer together than in voltage maps, because the voltage is an integral over current source density.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Units of current source density are voltage per unit distance per unit distance (e.g. µV/cm²) or current per unit area (e.g. µA/cm²). Conversion from the second derivative of the voltage to current units is a complex issue because this requires knowledge about conductivities of the skull and scalp surfaces. Therefore, µV/cm² is used, i.e. just the second derivative of the voltage distribution.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mapping/Tutorial ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The aim of this section is to generate map and source image displays. It is assumed that you have loaded EEG2 (data: sub-folder &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Examples\EEG_Focus\eeg2.eeg'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, electrode file: &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''eeg2.elb'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, filters variable 1.6-35 Hz, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Org ''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;montage).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Basic steps'''&lt;br /&gt;
&lt;br /&gt;
* 1. Move to the '''periodic pattern''' in EEG2 by clicking on the event marked at the middle of the event bar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (21).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* 2. Double click on any of the peak deflections to set a mark at the cursor position. A '''vertical bar''' (dark red on a yellow background) will be set, and '''Voltage maps''' will be displayed automatically. The latency will be shown at the bottom of the map window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (22).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;3. Repeat double clicking on several different peaks to view the maps at different latencies. Type the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to close the map window.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;4. Press the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''SRC'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button, and from the dropdown menu select the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'' TR-Temporal Region ''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;montage. Double-click on one of the peaks to display voltage maps again.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;5. Press the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''IMG '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button, so that it remains down. The map display changes to &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''source images'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; calculated from the magnitude of the source channels at the marked latency.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (23).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;6. Repeat double clicking on several different peaks to view the source images at different latencies. Click on the up/down arrows to the right or left of the scaling bar below the images to increase or decrease scaling.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;7. Select a prominent peak and double click to display the source images. On the keyboard press the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''left and right arrows'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to display source images at the next/previous sampling point or 5 ms later/earlier. Click on the up/down arrows right or left of the scale bar to increase or decrease scaling.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;8. The latency should still be marked from the previous step. Type M to display voltage maps instead of the source images at the currently marked latency, and type 'i' again if you want to view the source images.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;9. Press the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''IMG'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button again. Source images are switched off and 3D amplitude maps are displayed. Click on a map to convert the display from&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''' standard'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''sequential'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; view.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;10. Click and drag on a map to rotate the head to a new position. Note how all the maps in the sequential view are redrawn in the new position.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;11. Try out the various controls on the 3D map toolbar (at the top of the map window. See chapter &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''“3D Maps”''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for descriptions of the toolbar controls. Finally, switch back to 2D maps by disengaging the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''3D'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
*&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;12. You may also select &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Voltage maps'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or any other process from the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;menu when a latency is marked and a source montage is displayed. Note that voltage maps can be displayed in all montages by clicking anywhere on the EEG, if the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''IMG'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button is not down.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;13. Select average reference montage &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''''Avr'''''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, and repeat double clicking on several different peaks (Note that typing 'i' will change to the last active source montage again and display source images).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;14. Display voltage maps and make sure that electrodes are shown (if not, right-click on one of the heads, and select &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Show Electrodes'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; from the popup menu. If selected, the electrode locations, projected on the 6 different views of the head model, will be displayed. Select &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Top Meridian Projection'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; from the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options/Mapping'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; menu to display a sequence of maps in equidistant steps relative to the marked latency. Note that the sequential maps present top views in meridian projection down to the level of F9, T9, P9, F10, T10, P10. By using spline interpolation, the maps are capable of covering this wider range as compared to traditional maps. Deselect top view sequential maps again.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Map and source image sequences'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;1. Select file &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''segm1.eeg'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; and select the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''TA_Temporal Lobe ''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;source montage. Engage the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''IMG '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button. The &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''''TA '''''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;montage includes basal, anterior, and lateral temporal brain regions. Note how this montage suggests the onset of the spike in the left basal temporal lobe, with subsequent components in the anterior tip and lateral surface of the left temporal lobe.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;2. Double click on the positive (upward-going) peak on the third channel from the top of the screen (left lateral temporal lobe). The source image will be displayed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;3. Click on the left lateral head view (top left source image). Note how the cursor changes to a hand over areas where clicks initiate an action. A series of 15 equidistant source images around the cursor latency will be displayed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (24).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* 4. Click on the left/right arrows at the left at the top of the map display to page 7 maps backward or forward.&lt;br /&gt;
* 5. Click on the left/right arrow at the right at the top of the map display to decrease or increase the interval between the sequential maps. Alternatively, you may set the interval in &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Interval between Sequential Maps'''&amp;lt;/span&amp;gt; in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Options/Mapping'''&amp;lt;/span&amp;gt; menu.&lt;br /&gt;
* 6. Type 'm' or 'v' to view a sequence of amplitude maps in the same time range (click the rotate-left button and the rotate-up-down button twice each to arrive at the head positions shown below):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Mapping (25).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Manual</id>
		<title>BESA Research Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Manual"/>
				<updated>2021-05-05T13:32:29Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size: 150%;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Welcome to BESA Research&amp;lt;/strong&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BESA Research is the most widely used software for source analysis and dipole localization in EEG, MEG, Evoked Potentials and ERP research. BESA Research has been developed on the basis of over 20 years of experience in human brain research by Michael Scherg, University of Heidelberg, and Patrick Berg, University of Konstanz.&lt;br /&gt;
&lt;br /&gt;
BESA Research provides many advanced features for automatic source localization, fast modelling and easy, interactive hypothesis testing. Source analysis can be performed simultaneously on multiple conditions with advanced constraints based on anatomy and physiology. In addition to discrete multiple dipole modelling, all major distributed imaging methods are also available for comparison. This makes BESA a complete all-in-one tool for source imaging.&lt;br /&gt;
&lt;br /&gt;
BESA has all the features required to perform offline processing of continuously acquired EEG and MEG data using external and internal triggers, e.g. generated from an EMG channel or by spatio-temporal pattern search. Triggers are automatically mapped into predefined paradigms to provide for a fast selection of combinations of averages (addition, subtraction, subsets). Based on the spatial components approach of Berg and Scherg (1994), artifacts (e.g. eye and ECG) can be corrected on the fly from EEG, MEG, and ERP data.&lt;br /&gt;
&lt;br /&gt;
Special viewing options allow for easy selection of averaged or single epochs of interest (e.g. spikes) and for immediate source localization and analysis. Digitized 3D sensor locations can be used to coregister EEG or MEG data with structural and functional MRI. Fitted dipole sources can be superimposed directly to the individual MR image. Using the interactive link with the famous BrainVoyager software of Dr. Rainer Goebel, BOLD clusters in functional MRI (fMRI) can be used directly as seeds for dipoles sources.&lt;br /&gt;
&lt;br /&gt;
Information about updates and new releases can be found on the BESA homepage http://www.besa.de&lt;br /&gt;
&lt;br /&gt;
== Review ==&lt;br /&gt;
&lt;br /&gt;
[[Review]]&lt;br /&gt;
&lt;br /&gt;
[[BESA Research Montage Editor|Montage Editor]]&lt;br /&gt;
&lt;br /&gt;
[[BESA Research Mapping|Mapping]]&lt;br /&gt;
&lt;br /&gt;
[[BESA Research Artifact Correction|Artifact Correction]]&lt;br /&gt;
&lt;br /&gt;
[[BESA Research Spectral Analysis|Spectral Analysis (FFT and DSA)]]&lt;br /&gt;
&lt;br /&gt;
[[BESA Research ERP Processing|ERP Processing]]&lt;br /&gt;
&lt;br /&gt;
[[BESA Research ICA|Independent Component Analysis (ICA)]]&lt;br /&gt;
&lt;br /&gt;
[[BESA Research Batch Processing|Batch Processing]]&lt;br /&gt;
&lt;br /&gt;
== Source Analysis ==&lt;br /&gt;
&lt;br /&gt;
[[Source Analysis Introduction|Starting the Source Analysis Module]]&lt;br /&gt;
&lt;br /&gt;
[[Discrete Sources]]&lt;br /&gt;
&lt;br /&gt;
[[Source Analysis Functions of the Window|Functions of the Source Analysis Window]]&lt;br /&gt;
&lt;br /&gt;
[[Source Analysis Head Models|Head Models]]&lt;br /&gt;
&lt;br /&gt;
[[Source Analysis 3D Imaging|3D Imaging]]&lt;br /&gt;
&lt;br /&gt;
== Integration with MRI and fMRI ==&lt;br /&gt;
&lt;br /&gt;
[[Integration with MRI and fMRI]]&lt;br /&gt;
&lt;br /&gt;
== Source Coherence ==&lt;br /&gt;
&lt;br /&gt;
[[Source Coherence Introduction and Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[Source Coherence How to...]]&lt;br /&gt;
&lt;br /&gt;
== Export ==&lt;br /&gt;
&lt;br /&gt;
[[Export]]&lt;br /&gt;
&lt;br /&gt;
== MATLAB Interface ==&lt;br /&gt;
&lt;br /&gt;
[[MATLAB Interface]]&lt;br /&gt;
&lt;br /&gt;
== Special Topics ==&lt;br /&gt;
&lt;br /&gt;
[[Electrodes and Surface Locations|Working with Electrodes and Surface Locations]]&lt;br /&gt;
&lt;br /&gt;
[[The Initialization File: BESA.ini]]&lt;br /&gt;
&lt;br /&gt;
[[Working With Additional Files]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_ERP_Processing</id>
		<title>BESA Research ERP Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_ERP_Processing"/>
				<updated>2021-05-05T13:29:59Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
==  &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;ERP Processing and Averaging&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== The Event-Related Potentials (ERP) Module - Introduction ===&lt;br /&gt;
&lt;br /&gt;
The Event-Related Potentials (ERP) module provides many features that assist you with the analysis of event-related and evoked potentials and fields. These features, which are explained below, include&lt;br /&gt;
&lt;br /&gt;
* defining triggers and conditions on the basis of experimental paradigms&lt;br /&gt;
* simultaneous averaging of multiple conditions&lt;br /&gt;
* viewing and analyzing averaged results in a Top Viewer window, e.g. for peak finding and measurement of amplitudes&lt;br /&gt;
* Grand Average and combining of conditions&lt;br /&gt;
* a Schmitt Trigger tool which makes it easy to convert EMG/EEG artifacts into trigger events&lt;br /&gt;
* a tool for editing triggers&lt;br /&gt;
* import and export of triggers from/to ASCII file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Coherence analysis is covered in the chapter on ''Source Coherence''.&lt;br /&gt;
&lt;br /&gt;
A comprehensive review of the features is given in the online help chapter ''&amp;quot;ERP / Reference&amp;quot;. ''Detailed tutorials can be found in help chapter ''&amp;quot; ERP / Functions of the ERP module&amp;quot;'' under the corresponding section.&lt;br /&gt;
&lt;br /&gt;
=== Paradigms for Averaging ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction ====&lt;br /&gt;
&lt;br /&gt;
Paradigms allow to use scripting techniques for averaging of multiple recordings.&lt;br /&gt;
&lt;br /&gt;
They keep track of all relevant settings for averaging and make it easy to perform all necessary steps for optimal averaging of the data with a few mouse clicks. Each experimental task is described by a condition, in which trigger events are selected for averaging on the basis of user-defined boolean statements. Conditions can later be combined, e.g. to create grand averages or to form different conditions.&lt;br /&gt;
&lt;br /&gt;
The process of editing paradigm definitions is started using the menu entries &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Open Paradigm'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Edit Paradigm'''&amp;lt;/span&amp;gt;, or the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' ERP'''&amp;lt;/span&amp;gt; push button in the main window, as shown in the figure below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[Image:ERP Processing (1).gif|thumb|300px|ERP menu. Select Open Paradigm to open a pre-defined paradigm file.]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[Image:ERP Processing (2).gif|thumb|500px|BESA Research browses to the folder of pre-defined paradigms automatically. From the 'Directories' drop-down menu, the current data directory can be quickly accessed as well.]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whereas '''''Open Paradigm''''' asks for a pre-defined paradigm file, '''''Edit Paradigm''''' opens the last used paradigm file for the current data set. If no paradigm is present, a new paradigm with default settings is created automatically. The &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP'''&amp;lt;/span&amp;gt; push button tries to open the last used paradigm file. If it does not exist, the '''''File Open''''' box appears.&lt;br /&gt;
&lt;br /&gt;
The paradigm is defined using 6 (with Source Coherence Module 7) different dialog tabs. Each summarizes one aspect of the paradigm:&lt;br /&gt;
&lt;br /&gt;
* Trigger: define trigger codes by assigning names and other attributes. Attributes (e.g. &amp;quot;intensity&amp;quot;) help to group triggers.&lt;br /&gt;
* Condition: define a condition that selects trigger events from the experiment. Logical expressions can be combined to filter, for example, only the correct responses to a given task.&lt;br /&gt;
* Epoch: define epochs for averaging, baseline, artifact rejection, stimulus artifacts, and possibly a delay in trigger administration&lt;br /&gt;
* Filter: edit filter settings for averaging&lt;br /&gt;
* Artifact: reject artifacts by means of an interactive graphical rejection tool&lt;br /&gt;
* Average: select conditions for averaging and perform the average&lt;br /&gt;
* Coherence: specify settings for the time-frequency transformation (Source Coherence Module required)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Trigger ====&lt;br /&gt;
&lt;br /&gt;
By default, triggers are defined by the trigger code. However, this definition is arbitrary and working with numbers instead of names is error-prone. The Trigger dialog tab in the Paradigm property sheet enables naming triggers and grouping triggers by making use of attributes. These attributes can be freely assigned, and each trigger obtains a unique definition for its attributes.&lt;br /&gt;
&lt;br /&gt;
Generally, the suggested order in which to proceed for trigger definition is:&lt;br /&gt;
&lt;br /&gt;
# Define the attributes which cover all the different sub-groups of triggers&lt;br /&gt;
# For each attribute, define the different values the attribute can take&lt;br /&gt;
# Define the triggers by selecting the code and the appropriate attribute values, and using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Set '''&amp;lt;/span&amp;gt;button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ''Trigger ''dialog tab contains two main sections: The upper part is used to define attributes and attribute values for the triggers, whereas the lower part shows the current definitions.&lt;br /&gt;
&lt;br /&gt;
For example, to assign names to the trigger codes:&lt;br /&gt;
&lt;br /&gt;
* Enter names in the edit boxes of the ''Attribute Values'' section (below the attribute “name”)&lt;br /&gt;
* Add them to the list using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add to List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
* Define them by selecting code and name in the list box under the attribute “name” and clicking the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Set'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
''Trigger tab. The trigger codes are shown. The attribute “name” is defined automatically.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Condition ====&lt;br /&gt;
&lt;br /&gt;
A condition holds all information connected with a task or a specific event type.&lt;br /&gt;
&lt;br /&gt;
In the ERP module, averaging is performed on the basis of conditions. A condition is given by a logical expression that defines which trigger events are accepted for averaging. The &amp;quot;condition&amp;quot; tab makes it possible to define complex logic expressions and to see immediately how many matching trigger events result.&lt;br /&gt;
&lt;br /&gt;
The example conditions shown in the figure below are defined in Tutorial 1: ''‘Using a P300 Paradigm for'' ''Averaging ''' in help chapter ''“ERP / Functions… / Paradigms for Averaging”,'' which gives a comprehensive overview of the features of the averaging module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (2).png ]]&lt;br /&gt;
&lt;br /&gt;
''Editing a paradigm: Conditions can be defined by combining trigger definitions using boolean logic. This example shows definitions of three conditions (Rare, Standard, Hit) with a different number of matching events (40, 160, 134).''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Epoch ====&lt;br /&gt;
&lt;br /&gt;
The dialog tab'' Epoch'' is used to set the epochs which define the averaging interval. For each condition, an individual set of epochs can be defined for averaging by the edit boxes at the top of the dialog tab. At the bottom of the tab, the current settings for all conditions can be viewed.&lt;br /&gt;
&lt;br /&gt;
The push buttons in the center of the tab control the editing process. Two push buttons at the bottom right are for loading and saving a paradigm file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (3).png]]&lt;br /&gt;
&lt;br /&gt;
''Epoch tab. 4 different epochs can be defined for each condition. A stimulus delay time can also be specified.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Filter ====&lt;br /&gt;
&lt;br /&gt;
The ''Filter ''dialog tab allows you to change filter settings prior to averaging the data. The low and high pass filters can be chosen differently for the artifact scan and the average. '''Note''': If the paradigm is edited for the first time, default filter settings are used. These can differ from the filter settings which you set in the review window. If a paradigm file was opened which does not contain filter settings, the filter settings which were chosen in the base module are displayed in the dialog tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (4).png]]&lt;br /&gt;
&lt;br /&gt;
''Filter tab. Low cutoff, high cutoff, and band pass filters can be applied.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Artifact ====&lt;br /&gt;
&lt;br /&gt;
The ''Artifact'' dialog tab provides an easy way to define artifact rejection thresholds and to exclude bad channels and bad sweeps from the analysis. This is achieved by scanning the data file and then using the graphics display presented in the center of the dialog tab, which shows channels and sweeps sorted according to user-defined criteria.&lt;br /&gt;
&lt;br /&gt;
If the user does not check any of the options ''Fixed Thresholds'' and ''Artifact Scan Tool'', only regions that were explicitly marked as artifacts by the user will be excluded from the averages. If the option ''Fixed Thresholds'' is checked, the thresholds given in the edit boxes for amplitude and gradient are used to reject sweeps contaminated by artifacts.&lt;br /&gt;
&lt;br /&gt;
The option ''Artifact Scan Tool'' provides an interactive tool for the comprehensive detection and rejection of both artifact-loaded channels and sweeps.&lt;br /&gt;
&lt;br /&gt;
The figure below shows the result of an artifact scan. The trials are depicted in the columns of the display, sorted according to the highest amplitudes. Trials are rejected by mouse drag of the vertical cursor or by adjusting the rejection threshold for maximum amplitude, gradient, or minimum variance within a trial. The channels are depicted in the rows of the display, sorted according to the mean amplitude values over the trials. Similarly to excluding trials, a mouse drag of the horizontal cursor at the top of the display excludes channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
''Artifact scan result. The channel at the top shows significantly higher amplitudes than the rest, indicated by the lighter color. Trials in the rightmost columns have been excluded from averaging.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Average ====&lt;br /&gt;
&lt;br /&gt;
The ''Average'' dialog tab is used to define&lt;br /&gt;
&lt;br /&gt;
* which conditions are averaged&lt;br /&gt;
* which range of the data file is searched for trigger events matching the conditions&lt;br /&gt;
* whether automatic or query search is performed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The left part of the ''Average'' tab contains radio buttons to select the search range within the data file.&lt;br /&gt;
&lt;br /&gt;
The central part contains a list of available conditions and of available constraints for averaging.&lt;br /&gt;
&lt;br /&gt;
The list box array at the bottom shows the active and inactive conditions, the total number of matches, and the selected constraints. It provides an overview about the conditions which are selected. To add a condition to the list, select the condition and the constraint in the list boxes at the top, and click the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add to List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
The right part contains additional sections for defining statistics and toggling between query averaging and automatic averaging.&lt;br /&gt;
&lt;br /&gt;
Two push buttons at the bottom right are for loading and saving a paradigm file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
''Averaging tab. Range, conditions, and constraints for split-half averaging can be adjusted.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The tutorial in help chapter ''&amp;quot;ERP / Functions... / Paradigms... / Tutorial 1: Using a P300 Paradigm for'' ''Averaging&amp;quot;'' gives an introduction to the available features. Different conditions can be combined to analyze experimental paradigms of high complexity.&lt;br /&gt;
&lt;br /&gt;
A detailed description of the features can be found in the electronic help chapter ''&amp;quot;ERP / Reference / Using Paradigms to Average&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Tutorial 1: Using a P300 Paradigm for Averaging ====&lt;br /&gt;
&lt;br /&gt;
This example illustrates how to define and evaluate experimental paradigms using the ERP module. We will work on an experiment with an auditory oddball paradigm. The paradigm involves frequent and rare tones of different pitch and a motor response. The following list shows the encoding of the three different events to triggers:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;width:16.374cm;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#ffffff;border:0.5pt solid #00000a;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''File name'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Triggers'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
| style=&amp;quot;color:#00000a;&amp;quot; | &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Motor response to'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|- style=&amp;quot;background-color:#ffffff;border:0.5pt solid #00000a;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Freq-1200Hz-Resp-L.cnt&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|| Frequent tone (1200Hz)&lt;br /&gt;
&lt;br /&gt;
Rare tone (800Hz)&lt;br /&gt;
&lt;br /&gt;
Motor response (left hand)&lt;br /&gt;
|| Trg. 1&lt;br /&gt;
&lt;br /&gt;
Trg. 2&lt;br /&gt;
&lt;br /&gt;
Trg. 128&lt;br /&gt;
|| frequent tone&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The electrode positions were digitized. The file with the extension Freq-1200Hz-Resp-L.sfp contains the digitized 3D coordinates for the EEG.&lt;br /&gt;
&lt;br /&gt;
Follow the steps in the next section to see how the ERP module allows to customize the paradigm and to evaluate and average conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Open a pre-defined paradigm'''&lt;br /&gt;
&lt;br /&gt;
'''1. Load data'''&lt;br /&gt;
&lt;br /&gt;
* Load data file &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Freq-1200Hz-Resp-L.cnt'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot; in the folder &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Examples\ERP-P300-Auditory''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* Select ''File/Head Surface Points'' and ''Sensors/Load Coordinate Files...'' Browse for the coordinate files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''P300-Aud.ela'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''P300-Aud.sfp '''&amp;lt;/span&amp;gt; in the first two rows. They contain the type and location of the recorded electrodes. Enter '8mm' as electrode thickness, because in this example the coordinates specified in the sfp-file were measured 8mm away from the head surface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (7).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Open a pre-defined paradigm definition'''&lt;br /&gt;
&lt;br /&gt;
* Choose the menu entry &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP/Open Paradigm'''&amp;lt;/span&amp;gt;. A file selection box appears.&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (2).gif ]]&lt;br /&gt;
&lt;br /&gt;
* Choose the folder &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''&amp;quot;Auditory&amp;quot;''&amp;lt;/span&amp;gt; and open the paradigm file &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''P300.PDG'''&amp;lt;/span&amp;gt;&amp;quot;. Note that the combo box at the bottom of the file selection box enables a fast change between the default paradigm directory, and the directory where the data is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The dialog box that appears consists of several pages (&amp;quot;tabs&amp;quot;). The tab which you see is divided into three sections. The list box on the left shows the current number of matches for all defined conditions. In this case, 3 conditions are defined:&lt;br /&gt;
&lt;br /&gt;
* Rare&lt;br /&gt;
* Standard&lt;br /&gt;
* Hit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (2).png ]]&lt;br /&gt;
&lt;br /&gt;
Upon reading the paradigm, the conditions were automatically evaluated. For all three conditions, matches were found.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the list box in the center of the page, the currently defined conditions are displayed. The right part contains the command buttons. We will learn more about them later.&lt;br /&gt;
* Leave the page by selecting the tab &amp;quot;Epoch&amp;quot; at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Average conditions'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Edit Averaging Epochs'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (3).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All three lines are highlighted since they all hold the same epoch settings which were entered into the edit boxes in the top half of the tab.&lt;br /&gt;
&lt;br /&gt;
The epoch which is used for calculating the baseline is set to -100 ms (start position) and 0 ms (end position) by default.&lt;br /&gt;
&lt;br /&gt;
* Select the last condition &amp;quot;Hit&amp;quot; in the list by a single click with the left mouse button. The settings are automatically copied to the edit boxes. In the edit section, change the averaging epoch to -800 ms (start position) and +100 ms (end position). Click the button &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''&amp;quot;Assign to Selected&amp;quot;'''&amp;lt;/span&amp;gt; which changes the epoch settings for this condition only. This allows you to average the pre-stimulus potentials for the motor response selectively. You will notice that the artifact rejection interval was also updated, to fit into the newly defined averaging interval. Before you move on to the tab &amp;quot;Filter&amp;quot;, adjust the Baseline Definition Epoch to [-800 ms, -700 ms] and click the button &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Assign to Selected&amp;quot;.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Filter Settings'''&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;Filter&amp;quot; tab, the low-frequency cutoff filter and the high-frequency cutoff filter can be edited.&lt;br /&gt;
&lt;br /&gt;
* If the high cutoff filter is enabled for either artifact scan or averaging, disable it by clicking off the checkboxes. Switch to the &amp;quot;Artifact&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Artifact Rejection'''&lt;br /&gt;
&lt;br /&gt;
The artifact rejection tool offers two methods of artifact rejection. If the check box &amp;quot;''Fixed Thresholds''&amp;quot; is checked, the thresholds given at the right of the tab are used as limits that must not be exceeded in a trial. If the check box &amp;quot;''Artifact Scan Tool''&amp;quot; is checked, a scan of the data set is used to find artifacts.&lt;br /&gt;
&lt;br /&gt;
* Press the green &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Start Scan'''&amp;lt;/span&amp;gt;&amp;quot; button. The data file is scanned for artifacts. After the scan is completed, a color-coded representation of maximum signal in channels and trials appears. This scan only has to be performed once for a data file, unless conditions are changed. The next time the paradigm is opened with the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Edit Paradigm&amp;quot;''&amp;lt;/span&amp;gt; command (cf. part C of this tutorial), the scan result will be available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (5).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The trials of the three active conditions are sorted according to their maximum amplitude from left to right. The red bar at the bottom indicates which of the trials are currently marked as artifacts due to their high amplitude. The channels are sorted according to the mean of the maximum amplitudes of the trials from bottom to top. Move the mouse pointer to the top of the display. The cursor changes to an up-down arrow. Click and drag the cursor down with the left mouse button to exclude the topmost channel, which carries an EKG artifact.&lt;br /&gt;
* Click on the button &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Gradient'''&amp;lt;/span&amp;gt;&amp;quot; at the bottom of the dialog tab. The display changes to show the maximum gradients in the trials. The gradient is defined as the amplitude difference between two neighboring samples. Move the mouse pointer to the right edge of the display. When the cursor changes to a left-right arrow, click and drag the cursor to the left with the left mouse button to exclude the sweeps with the highest gradients, which are due to eye artifacts.&lt;br /&gt;
* At the new position of the dividing line which separates artifacts from good trials, press the right mouse button. A popup menu with information about the channel and trial at the cursor position appears.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (9).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Choose the menu entry &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Show Trial&amp;quot;.'''&amp;lt;/span&amp;gt; The trial is displayed in the EEG. If it still carries an artifact, more sweeps should be excluded.&lt;br /&gt;
* For more information about the artifact scan tool, please refer to the corresponding reference section in the electronic help. Switch to the &amp;quot;Average&amp;quot; tab now.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Averaging'''&lt;br /&gt;
&lt;br /&gt;
* At the bottom of the Average dialog tab, a list of currently selected conditions for averaging is shown. It already contains the three conditions for which matches were found in the EEG file. The right-most column indicates that all trigger events which matched the conditions will be averaged (&amp;quot;A&amp;quot;).&lt;br /&gt;
* Double-click on the condition &amp;quot;Hit&amp;quot; in the list box at the bottom. The cross in front of the condition name disappears, which indicates that this condition will not be averaged. Double-click it again to activate averaging of the condition again.&lt;br /&gt;
* Click the green button &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''&amp;quot;Average&amp;quot;'''&amp;lt;/span&amp;gt; on the right to start averaging. The progress is shown in an information window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To cancel the averaging process, press any key. A message box appears. If you choose &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''No'''&amp;lt;/span&amp;gt;&amp;quot; averaging is continued. Choosing &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Yes'''&amp;lt;/span&amp;gt;&amp;quot; stops the averaging process and asks you for a file name for each condition. After saving, the new averaged file is opened and the averaged segments are automatically displayed in the Top Viewer window. If you choose &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Cancel'''&amp;lt;/span&amp;gt;&amp;quot;, the results for the condition are not saved.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Edit a pre-defined paradigm'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Load data and paradigm file'''&lt;br /&gt;
&lt;br /&gt;
* With file &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Freq-1200Hz-Resp-L.cnt'''&amp;lt;/span&amp;gt;&amp;quot; open, choose menu entry &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP/Edit Paradigm'''&amp;lt;/span&amp;gt;, which opens the paradigm again (the copy of the paradigm file that was stored in the data directory), including the changes which were made in the last session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Edit trigger definition'''&lt;br /&gt;
&lt;br /&gt;
* Choose the tab &amp;quot;Trigger&amp;quot; on the top left. You now see the definition of triggers in the list view box at the bottom.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (8).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The top half of the tab contains the edit section. In the top row, attributes which describe experimental categories can be defined or deleted. The next row shows the attribute values which are available. The values which are currently active for the selected trigger code (left) are highlighted.&lt;br /&gt;
* Trigger code 128 does not have a proper definition for the attribute &amp;quot;frequency&amp;quot;. To change the definition:&lt;br /&gt;
** In the list box below the attribute &amp;quot;code&amp;quot; (left), choose code 128.&lt;br /&gt;
** In the edit box below the attribute &amp;quot;frequency&amp;quot;, type in &amp;quot;undefined&amp;quot;. Click the push button &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add to List'''&amp;lt;/span&amp;gt;&amp;quot; on the righthand side, which adds the new value into the list box and selects it automatically.&lt;br /&gt;
** Click the button &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Set'''&amp;lt;/span&amp;gt;&amp;quot; to set the new definition for trigger code 128.&lt;br /&gt;
** Alternatively: right-click with the mouse directly on the value which you want to change in the list view box at the bottom of the tab. See what happens... (more information about defining triggers can be found in the electronic help reference section).&lt;br /&gt;
** The definition for trigger 128 has changed. Choose the tab &amp;quot;Condition&amp;quot; (top of the page) to get back to the condition page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Edit conditions'''&lt;br /&gt;
&lt;br /&gt;
* Switch to the 'Condition' tab. Select the last line of the condition edit list box (center of page) by a single click with the left mouse button. The name of the condition appears in the top left corner of this section of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can edit the name in the name edit field, and rename the condition by clicking the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Replace&amp;quot;'''&amp;lt;/span&amp;gt;&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
Now we will add a new condition that links the standard stimulus with a response time:&lt;br /&gt;
A new condition is defined as follows: In the name field, type in a new name, e.g. &amp;quot;Resp_Time&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Qualifier&amp;quot;, select &amp;quot;CURRENT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Attribute&amp;quot;, select &amp;quot;type&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Operator&amp;quot;, select &amp;quot;IS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Value&amp;quot;, select &amp;quot;auditory&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Click the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''&amp;quot;Insert&amp;quot;'''&amp;lt;/span&amp;gt; button to start up the new condition. The name is automatically assigned to the new condition.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Qualifier&amp;quot;, select &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Attribute&amp;quot;, select &amp;quot;Interval&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Operator&amp;quot;, select &amp;quot;IS LESS THAN&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the edit box that appeared under &amp;quot;Value&amp;quot;, type 500.&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''AND&amp;quot;'''&amp;lt;/span&amp;gt; button to extend the condition.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Qualifier&amp;quot;, select &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Attribute&amp;quot;, select &amp;quot;name&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Operator&amp;quot;, select &amp;quot;IS&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the list box &amp;quot;Value&amp;quot;, select &amp;quot;response&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finish off the condition by clicking the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''&amp;quot;AND&amp;quot;'''&amp;lt;/span&amp;gt; button again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The new condition is automatically evaluated. 160 matches are found, i.e. in all cases, the response was within 500 ms.&lt;br /&gt;
* Select the line &amp;quot;Next.Interval IS LESS THAN 500 ms&amp;quot; in the condition. Enter the value &amp;quot;300&amp;quot; in the edit box at the top right of the tab and click the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Replace'''&amp;lt;/span&amp;gt;&amp;quot; button. The condition changes accordingly and is re-evaluated. Only 142 matches are found now.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (9).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* If you leave the dialog box with the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;quot; button, the settings are automatically stored in the data directory if the directory is writeable. If you choose the menu entry &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP/Edit Paradigm'''&amp;lt;/span&amp;gt; in the future, this specific definition will be opened.&lt;br /&gt;
* Choose ''ERP/Average'' again. You will see that four conditions are selected for averaging. The newly defined condition is active. If you just want to compare the condition &amp;quot;Resp_Time&amp;quot; with the one that did not have a time limit (&amp;quot;Standard&amp;quot;), select the other two entries (by holding down the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''CTRL'''&amp;lt;/span&amp;gt;&amp;quot; button on the keyboard while selecting) and click the button &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Remove from List'''&amp;lt;/span&amp;gt;&amp;quot; to remove these conditions from the averaging list. Only two conditions are now active for averaging.&lt;br /&gt;
&lt;br /&gt;
=== Top View of Data Segments ===&lt;br /&gt;
&lt;br /&gt;
Any EEG or MEG data segment can be viewed and analyzed in the Top View window. Waveforms are arranged according to their position on the head. The various options include peak finding, analysis and annotation, 3D mapping of amplitude or current source density, overplot of several conditions, and many more.&lt;br /&gt;
&lt;br /&gt;
A detailed description of the features is given in online help chapter “''ERP / Reference / Viewing and Analyzing Data in the Top View”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (10).png]]&lt;br /&gt;
&lt;br /&gt;
''Topographic view of averaged data in a 32-channel auditory evoked ERP experiment. Two conditions are overplotted. A map of the N100 in one condition is shown. Channel amplitudes at the N100 latency are displayed''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To view a segment or a set of segments in the Top View window, right-click on the segment waveforms and select '''''Top View''''' from the popup menu that appears. The Top Viewer window comes up, displaying the first segment in the data file. To switch to another segment, click on the segment name in the top line; select several segments for overplot by holding down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''&amp;lt;CTRL&amp;gt;'''&amp;lt;/span&amp;gt; key while clicking on the segment names. Note that even if several conditions are shown, only one condition is active for analysis. The active condition is indicated by bold print in the top line, and in the title bar of the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Measuring peaks and amplitudes'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Note: There are powerful tools for peak and amplitude analysis and export in the Combine Conditions, Channels, Find Peaks Module.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''''Peaks'''''&lt;br /&gt;
&lt;br /&gt;
To measure peaks and peak areas in the Top Viewer, right-click into a waveform between the baseline and the peak, and select the option '''''Find and Mark Peak''''' from the popup menu. If the peak is small, operate on the zoomed waveform: Right-click onto the waveform, select '''''Zoom Waveform''''' from the popup menu and then proceed to mark the peak. The ''Peak Finding'' dialog box appears and shows the result of the peak search:&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (14).gif ]]&lt;br /&gt;
&lt;br /&gt;
''Result of a peak search in the waveform of electrode T3 of a single epileptic spike. The peak amplitude is -50.7 µV. The peak latency is 5 milliseconds after the mid-latency of the search pattern.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A peak search can also be initiated from the menu entry &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Analysis / Find Peaks'''&amp;lt;/span&amp;gt;. The search channel and time range can then be specified in the top row of the dialog box. Click the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Find '''&amp;lt;/span&amp;gt;button to start the search.&lt;br /&gt;
&lt;br /&gt;
Please refer to the online help'' Reference ''chapter for a detailed description of the peak finding tool.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Waveform amplitudes'''''&lt;br /&gt;
&lt;br /&gt;
To display amplitudes at specific latencies, double-click on a waveform and drag the cursor to the desired latency or use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''left-right arrow keys'''&amp;lt;/span&amp;gt; on the keyboard. The latency is displayed at the bottom of the window, and a 3D map appears in the top right corner. From the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View '''&amp;lt;/span&amp;gt;menu, select the '''''Preferences''''' option. In the dialog box which appears, select the tick marks '''''Show Labels''''' and '''''Show Amplitudes''''':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (15).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Please note:''' Peak latencies and amplitudes can be determined over multiple files in a quick automatized way using scripts. Please refer to Chapter &amp;quot;''Batch Processing'' ''and Combining Conditions / Combine Conditions&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Montages'''&lt;br /&gt;
&lt;br /&gt;
The displayed montage in the Top Viewer can be any arbitrary montage. Peak amplitudes are automatically adapted to the currently applied montage. When the Top Viewer window opens, the montage selected in the BESA Research main window is selected by default. Use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Montage '''&amp;lt;/span&amp;gt;menu or click on the text at the bottom left to switch to another montage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Advanced viewing options'''&lt;br /&gt;
&lt;br /&gt;
Further options include:&lt;br /&gt;
&lt;br /&gt;
* Moving waveforms in the display, zooming individual channels, hiding channels, zooming the whole display.&lt;br /&gt;
* Selecting only a part of the epoch for display.&lt;br /&gt;
* 3D whole head mapping of voltage or current source density.&lt;br /&gt;
* Changing display options such as tick marks, channel labels, baseline information, font sizes, colors, and more.&lt;br /&gt;
* Display of standard deviations, and event-related (de-)synchronization (this requires bandpass filtering of the data during averaging, see the corresponding help chapter).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please refer to the online help chapter “''ERP / Reference / Viewing and Analyzing Data in the Top View'' for more information.&lt;br /&gt;
&lt;br /&gt;
=== Grand Averaging and Combining Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (16).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ERP Module allows for a quick combination of averaged segments, e.g. to create Grand Averages over subjects or to compute weighted sums and differences of conditions.&lt;br /&gt;
&lt;br /&gt;
Conditions from different recordings/subjects can be combined in a convenient way using scripts. The menu entry &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP/Combine Conditions, Channels, Find Peaks'''&amp;lt;/span&amp;gt;&amp;quot; allows for grand averaging and creating sums and differences between conditions. It also provides a tool for spatial and temporal resampling, and allows to perform an automatic peak analysis of multiple averaged files. For a detailed description of the 'Combine Conditions, Channels, Find Peaks' functions, please refer to the help chapter &amp;quot;'''[[BESA_Research_Batch_Processing#Combine_Conditions.2C_Channels|Batch Processing and Combining Conditions / Combine Conditions]]'''&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (17).gif ]]&lt;br /&gt;
&lt;br /&gt;
=== Managing Triggers ===&lt;br /&gt;
&lt;br /&gt;
==== Creating Triggers from EMG/EEG Channels ====&lt;br /&gt;
&lt;br /&gt;
It is possible to create new trigger events from any of the recorded channels. This is achieved by defining parameters that characterize the features of the event. After the parameters are defined, the whole EEG /MEG is searched for events which match the parameters, and new trigger events are created. The steps to be taken are illustrated in the help tutorial chapter [[BESA_Research_ERP_Processing#Tutorial_2:_Creating_Triggers_from_EMG|&amp;quot;''ERP / Functions... / Managing Triggers / Tutorial 2: Creating Triggers from EMG''&amp;quot;]].&lt;br /&gt;
&lt;br /&gt;
Briefly, the procedure to create triggers for a recurring pattern is as follows:&lt;br /&gt;
&lt;br /&gt;
1. Mark a typical occurrence of the pattern by left mouse drag.&lt;br /&gt;
&lt;br /&gt;
2. Use menu item &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Create Triggers from EMG/EEG'''&amp;lt;/span&amp;gt; to open the ''Schmitt Trigger'' dialog box.&lt;br /&gt;
&lt;br /&gt;
3. In the dialog box, select the channel you want to scan for triggers under'' Chan+.'' In most cases, it is advisable to go through section ''Trigger Channel Prefiltering'' and check the tick marks ''Differentiate, Rectify, Smooth After Rect'' and enter a value between 50 Hz and 100 Hz for the smoothing frequency (see figure below).&lt;br /&gt;
&lt;br /&gt;
4. Set the Schmitt Trigger parameters. The Schmitt Trigger is characterized by 4 parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Threshold''' (upper threshold): the threshold that the signal has to exceed&lt;br /&gt;
* '''Limit During Dead Time''' (lower threshold): the threshold that the signal must not exceed during the dead time before the trigger&lt;br /&gt;
* '''Dead Time (Prior to Trig)''': the time interval before the trigger where the signal must be lower than the lower thresholds&lt;br /&gt;
* '''Return Time (Below Limit)''': the time during which the signal has to return below the threshold&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click the button &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Current Settings'''&amp;lt;/span&amp;gt;. In the window that pops up, use the mouse drag to adjust the edges of the yellow block so that the lower threshold is above the pre-trigger baseline, and that the higher threshold stays well under the peak (vertical mouse dragging). Adjust the pre-trigger dead time (length of block left of the red line) which prevents recognizing each threshold crossing in a burst as trigger event, and the return time (horizontal mouse dragging).&lt;br /&gt;
&lt;br /&gt;
5. Click &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. The parameters are updated in the ''Schmitt Trigger'' dialog box.&lt;br /&gt;
&lt;br /&gt;
6. Click the buttons &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add to List'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Search Selected'''&amp;lt;/span&amp;gt; to start the trigger search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Triggers can be deleted again by calling the ''Schmitt Trigger'' dialog box again, selecting the corresponding entry in the list box, and clicking the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Delete Selected '''&amp;lt;/span&amp;gt;button. Triggers can also be deleted using the'' Edit'' ''Triggers'' command (see next section).&lt;br /&gt;
&lt;br /&gt;
A complete reference of the features is given in the online help chapter ''&amp;quot;ERP / Reference / Managing Triggers / Creating Triggers''&amp;quot;. An advanced topic explains the use of different filter settings using a myoclonic burst as an example (Strategies for Schmitt Trigger definition).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tutorial 2: Creating Triggers from EMG'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (18).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''The waveform of a trigger channel can be rectified and filtered to define trigger events. In the example above, the EMG channel FDIL is scanned for myoclonic discharges. The small window shows the waveform of the marked epoch after appropriate filtering.''&lt;br /&gt;
&lt;br /&gt;
==== Editing Triggers ====&lt;br /&gt;
&lt;br /&gt;
Patterns, tags, and markers can be converted into trigger events using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''''Edit Triggers'''''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; tool. After conversion, tags found in a pattern search can be used in conditions: they can be analyzed by the paradigm tool which controls and stores the complete pre-averaging process. This facilitates for example the averaging of epileptic spikes which were hand-marked or found by a pattern search (cf. chapter &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''&amp;quot;Review / Searching and Averaging&amp;quot;''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''''Edit Triggers'''''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; tool is also useful to delete triggers which were created earlier, to change trigger codes, or to create triggers for FFT averaging with graphical artifact rejection on the basis of the paradigm tool.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A detailed description of the features is given in the online help chapter ''&amp;quot;ERP / Reference / Managing Triggers / Editing Triggers&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (19).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''The'' Edit Triggers ''dialog box is divided into different sections to convert tags to triggers, delete triggers, convert other event types like markers to triggers, and change trigger codes.'' Creating triggers for spectral processing using the artifact scan tool of the ERP paradigm is covered by a different dialog.&lt;br /&gt;
&lt;br /&gt;
''Converting other event types to triggers'': This feature requires BESA Research 7.1 or higher.&lt;br /&gt;
&lt;br /&gt;
==== Event Files ====&lt;br /&gt;
&lt;br /&gt;
BESA Research stores events in a binary event file in the program data base. However, it can be useful to be able to export, edit, or import events. The ERP module allows to export and import event files in ASCII format with the menu commands &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Save Events As '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;and &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Open Event File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;. These event files can hold all types of events which occur during EEG or MEG recordings, e.g. triggers, comments, epochs, or tags. They can also be edited to change the type, latency, or number of events. For example, trigger events may be read in from an ASCII file, or the frequency of events of a certain type may be analyzed in a statistics software after exporting events.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A detailed description of the features and the format of ASCII event files is given in the online help chapter &amp;quot;''Help / ERP / Reference / Managing Triggers / Working with Event Files''&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Tutorial 2: Creating Triggers from EMG ====&lt;br /&gt;
&lt;br /&gt;
In this tutorial, myoclonic activity that was recorded via polygraphic channels is converted into trigger events.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Open the MEG+EEG file segment &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''myo_sect.foc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot; in the folder &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Examples\EEG -MEG -Myoclonic-Jerks''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot;. We will only inspect EEG channels during this tutorial and select the two relevant EMG channels as additional channels. Press the &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Scp'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot; button to display only EEG channels. Set the time interval to 4s and switch off the high cutoff filter (choose menu entry &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''&amp;quot;Filters/High Cutoff Filter / High Cutoff Filter Off&amp;quot;'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or use the '&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''HF'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;' button). Press the '&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add' '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button at the top right of the window and select the additional channel montage 'FDI-EMG'. The channels FDIL/FDIR which can be seen at the bottom of the window are the EMG channels recorded from the FDI muscles of the left and right hand.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;By clicking on the scaling button on the bottom right of the screen, adjust the voltage of the additional channels to 20 µV.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mark a block that encloses a time interval where the feature occurs, e.g. an EMG discharge (jerk) in channel FDIL:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (20).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;From the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; menu, select &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''&amp;quot;Create Triggers from EMG/EEG'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot;. The &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Schmitt Trigger settings'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; dialog box appears.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Press the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''Load' '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button and open the pre-defined trigger definition &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;''''EMG-Jerks.smt''''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (21).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Two definitions for triggers have already been set for comparison. They are listed in the list box at the bottom.&lt;br /&gt;
&lt;br /&gt;
Apart from the definition list, the box comprises three main sections.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;In the section &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''&amp;quot;Trigger Channel''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;s&amp;quot; choose a trigger code which you want to assign to the EMG artifact. As a default setting, the code 403 is suggested. In this example, accepted this default.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Select the channel that contains the information (FDIL) in the &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Chan. +&amp;quot;''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; dropdown list.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If you want to reference the channel against another channel, choose a reference channel from the &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Chan. –&amp;quot;''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; dropdown list. This is not necessary here.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;In the section &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Trigger Channel Prefiltering''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot; check the respective options if you want the channel pre-filtered according to the current filter settings (&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Initial Filtering&amp;quot;),''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; differentiated, rectified, and smoothed with an additional low-pass filter after rectification. Check the options 2, 3, and 4 (all except &amp;quot;Initial Filtering&amp;quot;). The cut-off frequency for the smoothing can be adjusted manually. Try 70 Hz as the smoothing frequency.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Click the button &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Current Settings'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot; to view the effect of the current filter settings on the signal in the specified channel. In our example, the result looks like this:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (22).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The yellow rectangle denotes the parameters which define whether the signal is accepted as a trigger event. Four parameters can be varied:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The top edge of the rectangle denotes the threshold which must be exceeded by the signal (green line).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The bottom edge of the rectangle denotes the pre-trigger threshold which must not be exceeded by the signal prior to the trigger event (red line). This ensures that in the case of multiple trigger events, events are excluded which may contain contributions from previous triggers.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The left edge denotes the &amp;quot;dead time&amp;quot; prior to the trigger event during which no other event is allowed to occur.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The right edge denotes the &amp;quot;return time&amp;quot; during which the signal must return below the bottom edge. If the event shows a slow decay, it is excluded. This prevents merged multiple events to be included.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Drag the bottom and the top of the rectangle up with the left mouse button to increase the thresholds. The result can look like this:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (23).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Clicking the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button leads back to the dialog box, where the four parameters (shown in the section &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Trigger Settings''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot;) have now been adjusted. By typing in the values manually, adjust the threshold to 40 µV, the limit during dead time to 25 µV, the dead time to 70 ms, and the return time to 30 ms.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Click the button &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add to List'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot; to complete the definition of the trigger event. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Click the button &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Search Selected'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot; to search the file for occurrences of the trigger event. After the end of the search, the number of detected trigger events is given in the list box. In this example, 39 trigger events were found.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Leave the dialog box with &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;&amp;quot;. The current settings are automatically saved in a file with the filename of the data file with the extension &amp;quot;SMT&amp;quot;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Press the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''SCP'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;' button again and page forward in the file using the space bar. In the screen that appears, mark a relatively small myoclonic signal in the FDIR channel:&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (24).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Choose the menu entry &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Create Triggers from EMG/EEG'''&amp;lt;/span&amp;gt; again. The dialog box automatically suggests a new trigger code. Choose the channel &amp;quot;FDIR&amp;quot; in the &amp;quot;Chan.+&amp;quot; combo box. Select the title bar in the list box at the bottom of the dialog box to make sure that no already defined trigger definition is selected. Click the button &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Current Settings'''&amp;lt;/span&amp;gt;&amp;quot;. The thresholds have to be lowered to yield a picture like this (corresponding to upper and lower thresholds of 14.8 µV and 8.5 µV):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ERP Processing (25).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click the button &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Search Selected'''&amp;lt;/span&amp;gt;&amp;quot;. Since no trigger definition is selected in the list box at the bottom of the dialog box, the settings which you have just entered are copied to the list box, and a search for myoclonic events in the FDIR channel is performed. For the settings quoted above, 17 trigger events are found.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the file is opened again later and the menu entry &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Create Triggers from EMG/EEG'''&amp;lt;/span&amp;gt; is chosen, the settings made earlier are automatically loaded from file. It is also possible to load different files or to save the settings to a different filename using the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load'''&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save'''&amp;lt;/span&amp;gt;&amp;quot; buttons.&lt;br /&gt;
&lt;br /&gt;
'''Note''': If one of the entries in the list box other than the header line is selected, the button &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View current settings'''&amp;lt;/span&amp;gt;&amp;quot; shows the settings of this particular entry. Since it is a fixed definition of a trigger, the thresholds cannot be changed graphically.&lt;br /&gt;
&lt;br /&gt;
For further information about conversion of EMG/EEG artifacts into trigger events, please consult the online help section in the Averaging Module Reference on &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''Strategies for Schmitt Trigger Definition''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_ICA</id>
		<title>BESA Research ICA</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_ICA"/>
				<updated>2021-05-05T13:23:31Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==  Independent Component Analysis ==&lt;br /&gt;
&lt;br /&gt;
=== ICA Analysis - Main Window ===&lt;br /&gt;
&lt;br /&gt;
ICA analysis allows decomposing EEG/MEG data into independent components. ICA decomposition is performed on the current screen and can be started from the ICA entry in the menu bar or by pressing the ICA button located in the button menu. The amount of data available in the current screen can be manipulated by using the time scaling button in the bottom right corner of the main window. The ICA menu contains the entries '''Current Screen''', '''Select Components''', '''Load Components''', and '''Options'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Image:ICA (1).jpg]] --&amp;gt;&lt;br /&gt;
[[Image:ICA_Analysis1a.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Choosing the option &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ICA / Current Screen'''&amp;lt;/span&amp;gt; will lead to the computation of an independent component analysis of the data available on the current screen. Filters are taken into account; bad channels are excluded. The amount of data available in the current screen can be changed by using the time scaling button in the bottom right corner of the main window (max. 1200 s).&lt;br /&gt;
&lt;br /&gt;
In case EEG and MEG data are both available, ICA analysis will only run on the data type that is selected by the EEG/MEG button. Running ICA on combined gradiometer/magnetometer data is not possible. It can only run on one channel type at a time.&lt;br /&gt;
&lt;br /&gt;
Before ICA is calculated, the dimensionality of data is optionally reduced by PCA. By default, all PCA components are ignored that explain less than 1% variance. The use of PCA can be switched off or the variance cutoff can be altered by pressing &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ICA / Options'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* '''Extended Infomax algorithm''' is based on the maximization of entropy and presents a natural gradient form for the independent components computation.&lt;br /&gt;
** Lee TW et al. Independent component analysis using an extended infomax algorithm for mixed sub-Gaussian and super-Gaussian sources. Neural Computation, 11(2), 1999, 409-433&lt;br /&gt;
*'''Second-order blind identification (SOBI)''' algorithm relies on second-order statistics that takes advantage of temporal correlations in the source activities.&lt;br /&gt;
**Belouchrani A et al. A blind source separation technique using second-order statistics. IEEE Transactions on Signal Processing, 45(2), 1997, 434-444&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ica2.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While ICA is being computed, the current analysis step is displayed in a dialog box along with the changing weights (see figure below). The first ICA step may take longer for many samples than the subsequent steps. In case the number of steps does not change within one second, one full stop is displayed after the step value, two full stops after 2 seconds, 3 full stops after 3 seconds, none after 4 seconds, 1 full stop after 5 seconds, etc. If ICA weights rise too strongly, ICA decomposition restarts with a smaller learning rate. In this case “Restarting” is displayed in the dialogue box. ICA analysis stops when the change of weights from 1 step to the next is smaller than 1.e-6 or after max. 500 steps. ICA analysis can be stopped by pressing the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Abort '''&amp;lt;/span&amp;gt;button in the dialog box.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ica3.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of the ICA analysis is displayed like a montage (see figure below). ICA waveforms have the labels ICA1 – ICAx. The menu item &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ICA / Current screen '''&amp;lt;/span&amp;gt;is ticked and the ICA button is pressed down. ICA components are sorted in descending order of their explained variance.&lt;br /&gt;
&lt;br /&gt;
The displayed ICA montage is automatically recomputed whenever ICA options change or the data change, e.g. when paging, filtering, changing the time-range to display, etc.&lt;br /&gt;
&lt;br /&gt;
The current ICA decomposition is calculated only taking the data of the current screen into account, but the result is applied on the whole data set. In case the time interval of the data shown on the current screen changes, no automatic recomputation of the ICA decomposition is going to be performed. Instead, an explicit re-calculation is required by clicking the menu item &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ICA / Current screen'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Choosing the option '''''Load Components''''', an ASCII file of previously stored or externally calculated ICA topographies can be loaded and displayed. The file must have the format of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.ica&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt; files described further down with the '''''Save Topography''''' option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ica4.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Right-clicking on an ICA label marks the label and opens a pop-up menu with the following options:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ica5.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pop-up menu can also be opened when more than one ICA components are selected (using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl'''&amp;lt;/span&amp;gt;-key).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Map Topography '''&amp;lt;/span&amp;gt;opens the 3D map of the currently selected ICA component (only one component can be selected for this option). The label of the currently selected ICA component is displayed in the bottom left corner of the mapping window. The function ''&amp;quot;Time-Series-Mapping” ''is deactivated when mapping ICA components as the topography does not change over time. Each map is scaled at 120% of its absolute maximum value.&lt;br /&gt;
&lt;br /&gt;
The option &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Define as Artifact Topography'''&amp;lt;/span&amp;gt; opens the “''Select Topographies” ''tab of the Artifact Correction Dialog (analogous to pressing ''Artifact / Select''). In this tab, the selected ICA component can be assigned to artifact categories HEOG, VEOG, Blink, EKG, Other1 or Other2. A maximum number of 10 ICA components can be selected at a time when using the artifact categories Other1 and Other2. For the other artifact categories, only 1 ICA component can be selected. &amp;amp;nbsp;After assigning an ICA topography to an artifact category, the topography map and artifact view are shown. Data are not automatically corrected, as this would prompt a new ICA calculation on artifact-corrected data. If the data contain more than one channel type, artifact correction based on ICA components is only available for the channel type on which the ICA was calculated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Send Topography to Source Analysis'''&amp;lt;/span&amp;gt; sends all selected ICA topographies to the Source Analysis module as ICA components. This is only possible if the Source Analysis window is open. Within the Source Analysis window, the ICA components can be displayed by pressing the ICA button. Right-clicking on an ICA label allows adding the ICA component(s) to the solution as spatial topographies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Topography'''&amp;lt;/span&amp;gt; saves all selected ICA topographies in an ASCII-file. This file can be opened in the Source Analysis window or reloaded with ''Load Components. ''File name and path can be selected in the standard saving dialog. The default name is the basename of the current file with the extension “&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.ica&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;”. If the data contain different channel types, the filename will be “*_&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''channeltype.ica'''&amp;lt;/span&amp;gt;” (e.g. “*_&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Eeg.ica'''&amp;lt;/span&amp;gt;”). The format of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.ica&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt; files is similar to artifact topography files (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.atf&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;). The first line contains the number of elements (channels) per ICA component (Nchan). The second line contains a list of channel labels and the channel type (Type). The following lines contain the ICA topographies, one topography per line. Each line begins with the corresponding ICA label. Please note that ICA topographies are not average referenced!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Nchan= &amp;lt;Number of elements (channels) per ICA topography&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;List of Nchan channel labels&amp;gt; Type= &amp;lt;BSA channel type als integer&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Label of the first ICA topography, e.g. ICA1&amp;gt; &amp;lt;ICA topography with Nchan elements&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Label of the second ICA topography, e.g. ICA2&amp;gt; &amp;lt;ICA topography with Nchan elements&amp;gt; &lt;br /&gt;
&lt;br /&gt;
... &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Label of the ith ICA topography, e.g. ICA8&amp;gt; &amp;lt;ICA topography with Nchan elements&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Export ICA Reconstructed Data Without Selected Components'''&amp;lt;/span&amp;gt;: Current Screen creates a new dataset '''without '''the selected ICA components and with the current filter settings only of the data shown on the '''current screen'''. This can be done on the basis of spatial components associated with the ICA topographies analogous to calculating model waveforms from source solutions. The ICA-reconstructed file is saved in BESA binary format with the extension “&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.ica.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;” and contains only those channels for which an ICA was initially computed. If the original data contain more than one channel types, the filename will be labeled according to the channel type used for the reconstruction, e.g. &amp;quot;*_&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Eeg.ica.fsg'''&amp;lt;/span&amp;gt;”. ICA-reconstructed data can for example be sent to source analysis to only perform source analysis on specific ICA components of interest.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Export ICA Reconstructed Data Without Selected Components'''&amp;lt;/span&amp;gt;: &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Whole File'''&amp;lt;/span&amp;gt; creates a new dataset '''without''' the selected ICA components and with the current filter settings of the '''entire dataset'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Operations on the decomposed data can also be performed from the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ICA Select'''&amp;lt;/span&amp;gt; window (menu item &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ICA'''&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''/ Select components'''&amp;lt;/span&amp;gt; - see figure below). The component name is displayed at the left, the explained variance at the right. When the Extended Infomax algorithm is used, components are sorted by variance. In SOBI algorithm case, the components are sorted by auto-correlation. If the option '''''Map when clicked''''' is checked, the topography of every component is displayed after clicking on it. A component can be selected by double-clicking. It will be marked by an asterisk and it is going to be omitted from the data when exporting with the options '''''Reconstruct: Screen''''' or '''''Reconstruct: Whole File'''''. The button &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Channel Display'''&amp;lt;/span&amp;gt; can be used to only show a part of the available ICA components on the screen. Finally, the button &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Topographies'''&amp;lt;/span&amp;gt; can be used to save the selected topographies (see the menu item &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Topography'''&amp;lt;/span&amp;gt; from the popup menu above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ica6.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== ICA Analysis - Source Analysis Window ===&lt;br /&gt;
&lt;br /&gt;
ICA components can be used in the Source Analysis window either by sending ICA topographies directly from the main window or by loading an ICA topography file (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.ica&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;) in the Source Analysis window (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File /'''&amp;lt;/span&amp;gt; &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load ICA components'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Please note that ICA decomposition is not computed within the Source Analysis window. The Source Analysis window must be opened before sending ICA topographies. The channel configuration of the ICA components and the data in the Source Analysis window must match. When ICA topographies are available in the Source Analysis window, the ICA/PCA toggle button is set to ICA. A waveform for the data-segment available in the Source Analysis window is reconstructed for each ICA component. The amount of variance each ICA component explains is displayed to the right of the according waveform. Additional ICA components can be appended to the ones already present in the Source Analysis window by pressing &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File / Append ICA components'''&amp;lt;/span&amp;gt;. One or more ICA components can be selected by using the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' shift '''&amp;lt;/span&amp;gt;or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ctrl'''&amp;lt;/span&amp;gt;-key and left-clicking in the ICA component labels. Right-clicking on one or several selected ICA component labels opens a menu with several ICA-related options (see. fig. 1):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:ica7.png]]&lt;br /&gt;
&lt;br /&gt;
''Figure 1''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Switch off / on ICA component(s)'''&lt;br /&gt;
&lt;br /&gt;
Selected ICA components are ignored in the Source Analysis window. Their labels and waveforms are greyed out. If data are sorted by the channel order, un-selected ICA components are automatically sorted to the bottom of the waveform panel. This can be helpful when many ICA components are sent to or loaded in the Source Analysis window. Un-selected ICA-components can be switched back on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add selected / all ICA components to solution'''&lt;br /&gt;
&lt;br /&gt;
One spatial component, corresponding to one ICA topography, per selected ICA label is added to the source solution. The absolute position of the displayed dipoles should not be interpreted as an accurate location, as it is located at the center of gravity of the according map. The source waveform associated with the spatial component is displayed in the Source Waveform panel in the middle of the Source Analysis window. Spatial components are the preferable choice for modelling artifact topographies in&lt;br /&gt;
&lt;br /&gt;
a source solution (rather than performing source analysis on artifact-corrected data). Spatial components can also be useful if parts of the signal are to be explained that are not of primary interest to the research question in order to reduce the amount of variance that needs to be explained by discrete source analysis.&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Automatic_Artifact_Correction</id>
		<title>BESA Research Automatic Artifact Correction</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Automatic_Artifact_Correction"/>
				<updated>2021-05-05T13:21:26Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version =  BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- == Automatic  Artifact Correction == --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Automatic correction is the easiest way to obtain artifact-cleared data for review. The estimation of the correction coefficients can be done using the whole EEG or an epoch defined by markers. If only one marker is set, the EEG is scanned from the beginning to the marker, or from the marker to the end, depending on the current position of the display. The longer the range, the more precisely the topography of the artifact can be defined. However, longer ranges increase computation time.&lt;br /&gt;
&lt;br /&gt;
In the Review Window, select the menu entry &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Artifact / Automatic'''&amp;lt;/span&amp;gt; to bring up the artifact selection dialog box:&lt;br /&gt;
&lt;br /&gt;
[[Image:Artifact Correction (3).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, EOG correction is computed using an internal model of eye artifact topographies. For automatic EKG correction, an EKG channel has to be defined. If markers are defined (see the figure below), the option ''Between Markers'' is ticked automatically.&lt;br /&gt;
&lt;br /&gt;
Clicking &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; starts the assignment of the artifact topographies, which can be interrupted at any time using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''''ESC' '''&amp;lt;/span&amp;gt;key on the keyboard.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Image:Artifact Correction (4).gif|400px]] --&amp;gt;&lt;br /&gt;
[[Image:Artifact Correction (4) new.png|500px]]&lt;br /&gt;
&lt;br /&gt;
''A block of EEG (the example file ''&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Examples\EEG-FOCUS\eeg2.eeg'''&amp;lt;/span&amp;gt;'') is shown containing eye artifacts. Markers have been placed on either side of the artifacts.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Image:Artifact Correction (5).gif|400px]] --&amp;gt;&lt;br /&gt;
[[Image:Artifact Correction (5) new.png|500px]]&lt;br /&gt;
&lt;br /&gt;
''Waveform display after automatic artifact correction. Virtual channels which carry the artifact signal are automatically appended at the bottom.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The corrected waveforms are shown, together with the channels HEOG and VEOG that depict the artifact signals. The oscillatory brain activity is not distorted by artifact correction. Note that correction is applied to scalp channels only. Non-scalp channels, e.g. polygraphic channels, are not corrected and are therefore unaffected by the correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Artifact Correction (6).gif]]&lt;br /&gt;
&lt;br /&gt;
''Above, a later segment of the EEG is shown, using the TA_Temporal-Lobe source montage, with and without correction. Note that, without artifact correction, the eye movements are depicted on the channels representing the anterior temporal lobe and frontal brain activity. After correction, the artifacts are greatly reduced without distorting the topography of the periodic discharges.''&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
For automatic correction of eye artifacts, sensor data is transformed back into source space using predefined source montages. The BR29 source montage is combined with the EOG-HVB source montage. This provides the advantage of separating brain activity of interest from artifacts.&lt;br /&gt;
&lt;br /&gt;
[[File:BR29 Source Montage - 3D view.png|640px|BR29 Source Montage]]&lt;br /&gt;
&amp;lt;br /&amp;gt; ''BR29 Source Montage''&lt;br /&gt;
&lt;br /&gt;
The BR29 source montage contains 29 (un-oriented) regional sources distributed in the entire brain space.&lt;br /&gt;
&lt;br /&gt;
[[File:EOG-HVB Source Montage - 3D view Sag.png|240px|EOG-HVB Source Montage (Sagittal view)]]&lt;br /&gt;
[[File:EOG-HVB Source Montage - 3D view Tra.png|240px|EOG-HVB Source Montage (Transversal view)]]&lt;br /&gt;
&amp;lt;br /&amp;gt; ''EOG-HVB Source Montage (Sagittal and transversal view)''&lt;br /&gt;
&lt;br /&gt;
The EOG-HVB source montage contains 3 spatial components to account for eye blinks (B-EOG), as well as vertical (V-EOG) and horizontal eye movements (H-EOG).&amp;lt;br /&amp;gt;&lt;br /&gt;
After the transformation, only the temporal activity of the three spatial components for the EOG-HVB source montage is used to compute the topographies for the average reference montage in sensor space. For this, the waveforms of the V-EOG and B-EOG dipoles are combined as one component using the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;VB &amp;amp;ndash; EOG = V &amp;amp;ndash; EOG^2 + B &amp;amp;ndash; EOG^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The H-EOG waveform is not modified. The H-EOG and VB-EOG waveforms are then correlated with the original data to detect EOG artifacts. The corresponding amplitude thresholds can be defined in the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Automatic Artifact Correction'''&amp;lt;/span&amp;gt; dialog. In the Review Window, select the menu entry &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Artifact / Automatic'''&amp;lt;/span&amp;gt; to bring up the dialog box.&lt;br /&gt;
&lt;br /&gt;
[[File:Artifact Correction (3).gif|320px|Automatic Artifact Correction Dialog]]&lt;br /&gt;
&amp;lt;br /&amp;gt; ''Automatic Artifact Correction Dialog''&lt;br /&gt;
&lt;br /&gt;
If the thresholds are exceeded, the current topography will be added to the accumulated topography. Please note that the eye artifact topography will change when scanning for artifacts in the data file and will become more accurate the more eye artifacts are found.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
* Ille N., Berg P., and Scherg M. A Spatial Components Method for Continuous Artifact Correction in EEG and MEG. Biomed. Tech., 1997, 42 (suppl. 1): 80-83.&lt;br /&gt;
* Ille, N., Berg, P., Scherg, M. Artifact correction of the ongoing EEG using spatial filters based on artifact and brain signal topographies. J. Clin. Neurophysiol. 2002, 19: 113-124.&lt;br /&gt;
&lt;br /&gt;
* Uusitalo, M.A., Ilmoniemi, R.J. Signal-space projection method for separating MEG or EEG into components. Med. Biol. Eng. Comput., 1997, 35: 135-140.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
[[Category:Methods]]&lt;br /&gt;
[[Category:Mathematical]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing</id>
		<title>BESA Research Batch Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing"/>
				<updated>2021-05-05T13:19:44Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==  Batch Processing and Combining Conditions == --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions and Batch Module: Introduction ==&lt;br /&gt;
&lt;br /&gt;
Functions of this module are started by selecting the menu operations &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Combine Conditions...'''&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Batch Scripts...'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''Combine Condition Scripts''' provides various operations on BESA averages.&lt;br /&gt;
* '''Batch Scripts''' provides batch operations on all data files.&lt;br /&gt;
* Note that a batch script can also be performed on the current file by selecting &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Run Batch...'''&amp;lt;/span&amp;gt;&amp;quot; or by typing the shortcut key &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''R'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== File List Tab ==&lt;br /&gt;
&lt;br /&gt;
Define a list of files on which the operations will be performed. The tab is the same for Combine Conditions Scripts and for Batch Scripts. Combine Conditions Scripts only allows you to open BESA average files (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, but also &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.raw'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.swf'''&amp;lt;/span&amp;gt;, and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt; if the files have a defined pre-stimulus interval), whereas Batch Scripts allows you to open any data file whose format is known to BESA Research.&lt;br /&gt;
&lt;br /&gt;
When the Combine-Conditions or the Batch module is started, all currently opened (Combine-Conditions: averages only) files are displayed in the list.&lt;br /&gt;
&lt;br /&gt;
To the right of each file name, the number of electrodes, total number of channels, and the sampling rate used in the file are displayed. In the Combine-Conditions module, the number of Epochs (segments) and the number of differently-named conditions are also shown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add files to the list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File '''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
* Drag one or more files from Windows Explorer onto the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Remove files from the list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and confirm the delete operation in the resulting dialog.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key to mark multiple files). Right click to obtain the context menu and select &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;quot;, or just press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Reorder files within the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctr'''&amp;lt;/span&amp;gt;l key to mark multiple files). Right click to obtain the context menu and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;, or hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key '''and '''press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrows'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sort the current file list alphabetically'''&lt;br /&gt;
&lt;br /&gt;
* Click on the File bar above the list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List'''&amp;lt;/span&amp;gt; button, or the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button to load the most recently used file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Which conditions are read from a source file? (Combine-Conditions module only)'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File list from Combine Conditions:'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (1).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Don't try to open here... (Batch only)'''&lt;br /&gt;
&lt;br /&gt;
By default, this checkbox is unchecked.&lt;br /&gt;
&lt;br /&gt;
In the checked state, BESA Research doesn't check if it can open the file. Use this function '''only''' if the file is ASCII and you want to use the '''ImportASCII '''batch command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File List from Batch Scripts''':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (2).png]]&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Batch Processing &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== Batch Processing Scripts ===&lt;br /&gt;
&lt;br /&gt;
With Batch Scripts, you can define a set of operations (e.g. Artifact Scan, Average, etc.) and apply these to several data files.&lt;br /&gt;
&lt;br /&gt;
These operations include&lt;br /&gt;
&lt;br /&gt;
* Load Paradigm&lt;br /&gt;
* Artifact Scan&lt;br /&gt;
* Average&lt;br /&gt;
* Export (and Merge)&lt;br /&gt;
* File Open (switch to another data file)&lt;br /&gt;
* Set filters&lt;br /&gt;
* Specify a montage (used, for example, for export to current montage)&lt;br /&gt;
* Run automatic eye and EKG artifact correction&lt;br /&gt;
* Define artifact topographies&lt;br /&gt;
* Turn artifact correction and view on and off&lt;br /&gt;
* Read and write events&lt;br /&gt;
* Edit default block epoch (for export around triggers)&lt;br /&gt;
* Edit triggers (for export around triggers)&lt;br /&gt;
* Mark a block for export, or send the block to Source Analysis or Top View&lt;br /&gt;
* Convert patterns to triggers&lt;br /&gt;
* Attach auxiliary files (e.g. elp, sfp) to the data file&lt;br /&gt;
* Send to MATLAB&lt;br /&gt;
* Specify display configurations for the BESA Research Main, SA, and Top View windows&lt;br /&gt;
* and more - see the full list of [[#Batch Commands|Batch Commands]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An additional set of commands are available for operations in the '''Source Analysis Module''', allowing to load, create and fit dipole models, and save the results.&lt;br /&gt;
&lt;br /&gt;
A further set of commands apply to '''Time-Frequency Analysis''', allowing to start TFC, change the display, save results, and run the beamformer or DICS analyses on a selected time-frequency range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
These operations will be extended in future program releases.&lt;br /&gt;
&lt;br /&gt;
The module includes two tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* '''File List''': Define a list of files on which the operations will be performed.&lt;br /&gt;
* '''Batch''': Define or load '''batch commands'''. Run the batch.&lt;br /&gt;
&lt;br /&gt;
=== Batch Tab ===&lt;br /&gt;
&lt;br /&gt;
Load or define batch commands, and then apply them to the files in the File List.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add Command'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; to add a new command to the batch. The following dialog is opened, showing the available commands:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Select the desired command and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; or double-click on the command. A dialog box is opened, allowing to specify individual command parameters.&lt;br /&gt;
* If you click on &amp;quot;Apply at beginning of batch&amp;quot; or &amp;quot;Apply at end of batch&amp;quot;, the command will only be run at the beginning or the end of a batch. You can use this, for example, at the end of a batch to start a MATLAB script to perform statistics on the results of the batch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load and Save Batch'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load a previously defined batch or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to save the current batch to a file (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.bbat&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load the most recently used batch file. Whenever a batch is run, the current set of commands is written to the file &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Previous.bbat in'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Scripts/Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; subdirectory. This file is loaded when you press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Clear All'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Clears all commands from the window.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''View Log File'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Each time a batch is run, BESA Research adds information about the batch to a log file, with headings showing the date and time the batch was started. The file is opened automatically in Internet Explorer if errors occurred during processing. Otherwise you may open the file by &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button here or in the dialog that is displayed at the end of batch processing. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The log file is saved in xml format, and a JavaScript is used to format the display in web browsers. JavaScript should be enabled in the browser to obtain an optimal display of the results. If JavaScript is enabled, the log file is displayed as a list of headings for each batch. Click on a heading to display the results of the corresponding batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;To open the log file in the Notepad, hold the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Shift '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;key down when pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Batch Command List'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Double-click on a command to edit it. See &amp;lt;/span&amp;gt;[[#Batch Commands|Batch Commands]]&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for descriptions of the dialogs that are opened to edit each command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Right click on a command to open a context menu allowing more options.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Move Up'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''and Move Down'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; can also be applied to multiple selections.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If you have made a multiple selection, the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button will delete all the marked commands. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;plus &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''cursor keys'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will move the marked commands up or down.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Comment'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove a semicolon (;) in front of the command, to deactivate or reactivate the command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Command Only at Start/End'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove the text &amp;quot;Start_&amp;quot; or &amp;quot;End_&amp;quot; in front of the command. With these prefixes, the command will only be performed when the first file (&amp;quot;Start_&amp;quot;) or the last file (&amp;quot;End_&amp;quot;) in the file list is being processed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Single Step Mode'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Check this item to step through the batch, one command at a time. A dialog is opened after each command, allowing to run the next command, continue the batch without single steps, or stop running the batch. See the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'' “Pause''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;” command for further details.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;During a batch, press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changes in batch written to database'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Checked by default. If this item is unchecked, file display settings, such as Montage setting and Artifact correction display, are not written to the database. When the file is next opened in BESA Research, the settings made in the batch are not retained.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Leave files in the file list open after running the batch'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If this item is checked, files in the file list will remain open after the batch. This is useful, for instance, if you want to open a set of files, specifying the same montage and/or filter settings for each file.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to start running the batch. Each command is then applied in succession to each file in the File List.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that, while a batch is running press and hold down the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The log file ===&lt;br /&gt;
&lt;br /&gt;
A protocol of each batch is written to the log file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Scripts/Log/Batch.xml.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File '''&amp;lt;/span&amp;gt;button, the file is opened in your default browser for xml files. The file will be opened automatically if there was an error during batch processing unless you have used the ''BatchError'' batch command to suppress this behaviour.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''DHTML formatting of the log file'''&lt;br /&gt;
&lt;br /&gt;
The xml file is formatted using JavaScript (Dynamic HTML). If JavaScript is enabled in your browser, you will first see a list of batch protocol titles, labelled by the date and time at which the batch was started. The most recent batch is at the top of the list.:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).png|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the title to view the protocol for the corresponding batch:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''JavaScript and XP Service Pack 2'''&lt;br /&gt;
&lt;br /&gt;
By default, if the log file is opened in Internet Explorer after XP Service Pack 2 has been installed, IE will warn you with the message: &amp;quot;''To help protect your security, Internet Explorer has restricted this file from'' ''showing active content that could access your computer&amp;quot;.'' All the protocols in the log file are displayed. You may safely click on the options to allow active content in the log file, if you want to display the file as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Backup of the log file'''&lt;br /&gt;
&lt;br /&gt;
When the log file is written, a backup of the previous version is written to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml.bak'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the size of the log file exceeds 200 KB, it is renamed to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml_date_time'''&amp;lt;/span&amp;gt; (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.xml_2004-10-08_10-53-32'''&amp;lt;/span&amp;gt;), and a new version of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml'''&amp;lt;/span&amp;gt; is created.&lt;br /&gt;
&lt;br /&gt;
=== Placeholders ===&lt;br /&gt;
&lt;br /&gt;
A powerful feature of the batch commands is the ability to define file names and specify standard paths using placeholders. These are text strings enclosed by percentage (%) signs. They can be used in all batch commands where file names are specified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Basename'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Placeholder !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; width=&amp;quot;10%&amp;quot;|'''%basename%'''&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|replaced by the basename of the currently opened file.&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%basename-n%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the last &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%-nbasename%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the first &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasename%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list (it has the same meaning as %basename% if no MAINFileOpen batch command was used in command list)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%base%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file without the path&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbase%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list without the path&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%ext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%basefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%t%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: time since start of batch on current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%T%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: current date and time&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%label%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Replace label of the most recent marked block by the block label, not including no. of averages&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%LABEL%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
| Replace label of the most recent marked block by the block label, including no. of averages&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%scripts%'''&lt;br /&gt;
|replaced by the path to the Scripts folder.&lt;br /&gt;
|&amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard MATLAB scripts used by BESA Research.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%montages%'''&lt;br /&gt;
|replaced by the path to the Montages folder.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%examples%'''&lt;br /&gt;
|replaced by the path to the Examples folder.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''%basename%''' -- replaced by the basename of the data file in the File List. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''%basename-n%''' -- replaced by the basename of the data file in the File List, but removing the last &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%-nbasename%''' -- replaced by the basename of the data file in the File List, but removing the first &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%scripts%''' -- replaced by the path to the Scripts folder (e,g, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard Matlab scripts used by BESA Research).&lt;br /&gt;
&lt;br /&gt;
* '''%montages%''' -- replaced by the path to the Montages folder.&lt;br /&gt;
&lt;br /&gt;
* '''%examples%''' -- replaced by the path to the Examples folder.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Placeholders for folders'''&lt;br /&gt;
&lt;br /&gt;
The following placeholders are the same as those used in the [Folders] section of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Besa.ini'''&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The strings enclosed by percent signs (%) are placeholders for the following folders in English-language versions of Windows. Folder names are different for the system and for other language settings. BESA Research will substitute the placeholders by the appropriate folder name for the Windows system and the system language:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 10 (English)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%localapp%''' = &amp;quot;&amp;quot;C:\Users[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;&amp;quot;Desktop[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%publicprog%''' = &amp;quot;Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;&amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Desktop\[User]\Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir%'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 7 (English):'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%localapp%''' = &amp;quot;C:\Users\[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;Desktop\[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%publicprog%''' = &amp;quot;C:\Users\Public\Public Documents\BESA\Research_7_1&amp;quot;. This folder is directly accessible from the Windows Explorer under &amp;quot;Libraries\Documents\Public Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;&amp;quot;Libraries\Documents\My Documents\Research_7_1&amp;quot; or &amp;quot;Desktop\[User]\My Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir% &amp;amp;nbsp;'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Batch Commands ===&lt;br /&gt;
&lt;br /&gt;
Batch commands are selected when the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt;&amp;quot; button is pressed in the &amp;quot;Batch&amp;quot; Tab. The commands are subdivided into five categories: General commands, commands for the Main module, for the Source Analysis module, imaging commands in the Source Analysis module, and commands for Time-Frequency Analysis. The commands have prefixes,''' GEN''', '''MAIN''',''' SA''', '''SAIMAGE''', and''' TFC'''), which identify the category. For compatibility with older program versions, old batches without the prefixes are accepted.&lt;br /&gt;
&lt;br /&gt;
Detailed descriptions of each batch command are available in the electronic help chapter “''Batch Processing and Combining Conditions / Batch Processing / Batch Commands”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands''' - prefixed with &amp;quot;'''GEN'''&amp;quot; (can be used anywhere):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot; style &lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| GENBatchError || used to change program behavior when errors occur&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENBatchWindowPosition&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the position of the batch window relative to the main window&lt;br /&gt;
|-&lt;br /&gt;
| GENComment || comment in the batch script: no batch functionality&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABcommand || send a command string to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABwaitForVariable || tells BESA to wait until Matlab has created a variable with the specified name.&lt;br /&gt;
|-&lt;br /&gt;
| GENPause || pause batch operations, allowing step-by-step operations&lt;br /&gt;
|-&lt;br /&gt;
| GENFor/GENEndFor|| a programming language-like FOR loop&lt;br /&gt;
|-&lt;br /&gt;
| GENRunProcess || runs a command-line process, e.g. an external program to perform part of the data analysis in the batch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENsaveBitmap&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SetVariable&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the value of the variable is inserted into subsequent batch commands where the text contains the name flanked by % signs&lt;br /&gt;
|-&lt;br /&gt;
| GENWindowPosition || set window size and positions to a selection of standard settings, e.g. for bitmap export&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for the Main Module''' - prefixed with &amp;quot;'''MAIN'''&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| MAINArtifactCorrect || run automatic artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactMethod || specify the method for artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactOn || turn artifact correction an artifact view on or off&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifact Scan || run an artifact scan as from the Paradigm Dialog&lt;br /&gt;
|-&lt;br /&gt;
| MAINAuxiliaryFiles || associate auxiliary files (e.g. *.''ela'', *.''sfp'') with the data file&lt;br /&gt;
|-&lt;br /&gt;
| MAINAverage || average the data&lt;br /&gt;
|-&lt;br /&gt;
| MAINBaseline || specify the parameters for baseline correction&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINDefineArtifactTopography&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || define an artifact topography&lt;br /&gt;
|-&lt;br /&gt;
| MAINEditDefaultEpoch || edit the default block epoch&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventRead || read events from an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventWrite || write events to an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINExport || export or append data in the selected target format&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINExportToBESAConnectivity&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || export data segments to BESA Connectivity&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFT || calculates the FFT spectrum of the marked data interval&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTmean || starts an averaging procedure that calculates the mean spectral properties in pre-defined regions&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTsave || saves FFT data (generated using the ''FFT Average option'' in the ''Average ''command) to disk (*.''fma)''&lt;br /&gt;
|-&lt;br /&gt;
| MAINFileOpen || close the current file and open a new file to which the remaining batch commands will be applied&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINFileClose&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || close the currently open file in a batch, provided it is not the current file in the File List&lt;br /&gt;
|-&lt;br /&gt;
| MAINFilter || set filters&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINfMRIArtifact&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns on the fMRI artifact removal&lt;br /&gt;
|-&lt;br /&gt;
| MAINGoTo || jumps with the cursor to the specified time point&lt;br /&gt;
|-&lt;br /&gt;
| MAINICA || starts ICA decomposition of data on the current screen &lt;br /&gt;
|-&lt;br /&gt;
| MAINICAsave || saves selected ICA components as topographies in a file&lt;br /&gt;
|-&lt;br /&gt;
| MAINICAselect || opens component selection dialog for managing ICA components&lt;br /&gt;
|-&lt;br /&gt;
| MAINImportASCII || import an ASCII file into a ''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'' file.&lt;br /&gt;
|-&lt;br /&gt;
| MAINMarkBlock || mark a data block (optionally send to Source Analysis)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMarkChannels&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || mark one or more channels, as given by the list&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMaxInInterval&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || within the current marked block, search for the largest absolute value on the specified channel&lt;br /&gt;
|- &lt;br /&gt;
| MAINMontage || change the montage (used by the Export command when saving to current montage)&lt;br /&gt;
|-&lt;br /&gt;
| MAINParadigm || load a paradigm file&lt;br /&gt;
|-&lt;br /&gt;
| MAINPatternToTrigger || convert a tag into a trigger&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINPolygraphicFilters&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || sets filters for polygraphic or added channels&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINScale&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set amplitude and time scales&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSearchAverageView&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start search average view&lt;br /&gt;
|-&lt;br /&gt;
| MAINSendToMATLAB || send data to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSplineConstant&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the spline constant used in spherical spline maps and channel interpolation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerRecode&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the command recodes a specified trigger number to a new number&lt;br /&gt;
|-&lt;br /&gt;
| MAINTriggerSelect || edit the trigger list (cf. ''Edit / Trigger Values''...)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerTagDelete&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || delete one or more triggers or tags&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewAverageBuffer&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turn on the Average Buffer View and place the specified buffer number to the left in the display&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewChannelType&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || select the channel type to display, and select channel types for mapping, export, etc&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewSelected&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns selected view on or off&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands for Source Analysis''' - prefixed with &amp;quot;'''SA'''&amp;quot; (but see also ''MarkBlock'', which is used to send a block of data to SA and open the SA window):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| SAAddSource || add a dipole or regional source to a model&lt;br /&gt;
|-&lt;br /&gt;
| SAChannelTypeForFit || switch between EEG, magnetometers or axial gradiometers, and planar gradiometers&lt;br /&gt;
|-&lt;br /&gt;
| SAConvertSource || convert a source from dipole to regional source, or from regional source to dipole&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalClara || run Cortical CLARA&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalLoreta || run Cortical LORETA&lt;br /&gt;
|-&lt;br /&gt;
| SADelete || delete current solution or all solutions or remove current fit interval or cursor&lt;br /&gt;
|-&lt;br /&gt;
| SADICS || start DICS computation (if DICS has been precomputed in the time-frequency image command)&lt;br /&gt;
|-&lt;br /&gt;
| SADisplayMRI || switch MRI display on/off and select small or large window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAElectrodeConfiguration&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || equivalent to pressing the Org or Std button in the Channel box of the Source analysis window&lt;br /&gt;
|-&lt;br /&gt;
| SAExit || close Source Module&lt;br /&gt;
|-&lt;br /&gt;
| SAFit || start fit&lt;br /&gt;
|-&lt;br /&gt;
| SAFitConstraint || set fit constraints, e.g. Residual Variance, Energy, Maximum Distance, Image Weighting, and their weights.&lt;br /&gt;
|-&lt;br /&gt;
| SAFitInterval || set fit or baseline interval&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAHeadModel&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the head model&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SALabelSource&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the label of the specified source number&lt;br /&gt;
|-&lt;br /&gt;
| SAMinimumNorm || run a minimum norm analysis&lt;br /&gt;
|-&lt;br /&gt;
| SANewSolution || open a new solution&lt;br /&gt;
|-&lt;br /&gt;
| SAOpenSolution || open a solution from a file&lt;br /&gt;
|-&lt;br /&gt;
| SAPCA || toggle PCA display of data or residual, and transfer a selected number of components to the source model&lt;br /&gt;
|-&lt;br /&gt;
| SARegularization || set the regularization values both for discrete and distributed source images&lt;br /&gt;
|-&lt;br /&gt;
| SASaveBitmap || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| SASaveLeadfields || save the leadfields of the current source model&lt;br /&gt;
|-&lt;br /&gt;
| SASaveModelWaveforms || save model waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveResidualWaveforms || save residual waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveRVandGFPWaveforms || save residual variance and global field power waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSolution || save the current solution&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceMontage || save a source montage&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceWaveforms || save source waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASendToMATLAB || send data, model, source waveforms, images, etc. to Matlab&lt;br /&gt;
|-&lt;br /&gt;
| SASetCursor || set the cursor&lt;br /&gt;
|-&lt;br /&gt;
| SASetDefaultSourceType || set the default source type (dipole or regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrActivateSource || Turn specified source on or off, or enable/disable source for fitting&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrientation || set orientation (of regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASwitchCondition || switch to a specified condition&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Distributed 3D Volume Images'''&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| SAIMAGEBeamformer || switch between Single Source and Bilateral Beamformer image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAIMAGEBeamformerTimeDomain&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start beamformer computation in the time domain&lt;br /&gt;
|-&lt;br /&gt;
| SAimageBrainAtlas || turns on the Brain Atlas overlay on volumetric image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGECLARA || generate CLARA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip image values under a threshold&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEExport || save the results of minimum norm or 3D imaging method&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEGotoMax || set the crosshair cursor at the nth maximum in the image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEImport || load a 3D volume image from file&lt;br /&gt;
|-&lt;br /&gt;
| SAimageImportFMRI || import fMRI image to Source Analysis Module&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELAURA || create LAURA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELORETA || create LORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESLoreta || create sLORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAimageSESAME || start SESAME computation&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESSLOFO || create SSLOFO image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEUser-Defined || create user-defined image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESaveLeadfields || save the leadfields of all the voxel sources in a 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESmooth || smooth current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESetCrosshair || set the position of the crosshair in the 3D image&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Time-Frequency Analysis''' ('''TFC''')&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot; &lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| TFCStartTFAnalysis ||(previously TFCgo) start TFC analysis using the current paradigm settings&lt;br /&gt;
|-&lt;br /&gt;
| TFCdisplay || change the TFC display (e.g. power/amplitude, coherence)&lt;br /&gt;
|-&lt;br /&gt;
| TFCsave || save numerical results to an ASCII file, or save a screenshot of the TFC window&lt;br /&gt;
|-&lt;br /&gt;
| TFCimage || start beamformer analysis on a selected time-frequency range&lt;br /&gt;
|-&lt;br /&gt;
| TFCSendToMATLAB || send TF results or single-trial data to MATLAB&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How to Average Your Data in a Batch  ===&lt;br /&gt;
&lt;br /&gt;
Using batch processing, several files from an experiment can be averaged at a time.&lt;br /&gt;
&lt;br /&gt;
Here we summarize the steps required:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Create the paradigm, and save the paradigm file.&lt;br /&gt;
* Open each individual data file to check the data:&lt;br /&gt;
** Make sure auxiliary files are defined and loaded properly, and the data are displayed correctly.&lt;br /&gt;
** Eyeball the data.&lt;br /&gt;
** Define bad (and interpolated) channels.&lt;br /&gt;
** Mark artifact time ranges.&lt;br /&gt;
** If required, set up artifact correction for the file.&lt;br /&gt;
** The data file can be closed again after this step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Preparing the batch'''&lt;br /&gt;
&lt;br /&gt;
* Open at least one&amp;amp;nbsp;file and select ''Process / Batch Scripts''.... The file(s) should be displayed in the file list. Alternatively, just select ''Process / Batch Scripts...,'' and add the files by&lt;br /&gt;
** pressing the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** dragging the files from Windows Explorer&lt;br /&gt;
** Opening a previously saved&amp;amp;nbsp;list with ''Load File List''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* You can delete files from the list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt;) or edit the file sequence using the right click context menu.&lt;br /&gt;
* Select the ''Batch Tab''.&lt;br /&gt;
* Add commands to your script. For averaging, these would normally be&lt;br /&gt;
** '''Paradigm''' -- to load the paradigm file&lt;br /&gt;
** '''Artifact Scan''' -- to run the artifact scan&lt;br /&gt;
** '''Average''' -- to perform the average&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Save these commands (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Test the commands on the files in the current file list: press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Look at the log file (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;) to check the results of averaging.&lt;br /&gt;
* Look at the data averages to make sure they have been done correctly.&lt;br /&gt;
* Repeat these steps until averaging is working properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Select ''Process / Batch Scripts''....&lt;br /&gt;
* Open the files you want to average in the batch in the file list:&lt;br /&gt;
** Any files that were open in BESA are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Edit the file list, e.g. delete unwanted files (use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; key or the right click context menu), or reorder the files (use &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl + cursor keys'''&amp;lt;/span&amp;gt; or context menu).&lt;br /&gt;
* Note that the order of files in the list specifies the order in which they will be processed in the batch script. This order will be important if all results are saved to the same target file. Otherwise the file sequence is not important.&lt;br /&gt;
* Optionally, save the file list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Select the ''Batch Tab'', and load the previously defined batch script with ''Load Batch''.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch.&lt;br /&gt;
&lt;br /&gt;
=== How to Merge and Compress raw data  ===&lt;br /&gt;
&lt;br /&gt;
Using the Export command in a batch, several data files can be merged into a single data file in BESA's data format (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.foc&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This can be useful if data from one subject have been collected in several data blocks, and you want to analyze all data blocks together.&lt;br /&gt;
&lt;br /&gt;
Optionally, to save space, data can be saved in compressed format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Files can be merged:'''&lt;br /&gt;
&lt;br /&gt;
* if they have identical channel configurations, or&lt;br /&gt;
* there are at least 16 EEG channels, and the export format is Standard 81 (i.e. EEG channels are interpolated to 81 standard locations). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''How to merge files:'''&lt;br /&gt;
&lt;br /&gt;
* Select '''Process / Batch Scripts...'''&lt;br /&gt;
* Add all the files that are to be merged to the file list:&lt;br /&gt;
** Any files that were open in BESA Research are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list (''Load File List'').&lt;br /&gt;
* Rearrange the files in the file list to the sequence in which they should be merged.&lt;br /&gt;
* Select the ''Batch Tab ''and insert an &amp;quot;''Export&amp;quot;'' command, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following dialog shows a possible configuration of the ''Export'' command:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The parameters shown in the Information box are the settings chosen in the ''Export Dialog'' when the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt; button has been pressed.&lt;br /&gt;
* '''Append if file already exists''' must be checked in order to merge the files.&lt;br /&gt;
* The '''target file name''' must be fixed, i.e. don't use the '''%basename%''' variable, because that will result in a different target file name for each source file.&lt;br /&gt;
* There are two variables that can be used for the segment label:&lt;br /&gt;
** '''%filename%''' will insert the basename of the source file into the segment label.&lt;br /&gt;
** '''%c%''' will insert the file number into the segment label. The number gives&amp;amp;nbsp;the position of the file in the file list. For instance, &amp;quot;File %c%&amp;quot; will generate the label &amp;quot;File 2&amp;quot; for the second file in the list.&lt;br /&gt;
&lt;br /&gt;
=== Example: Data averaging in the auditory intensity experiment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, two raw data files, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;, from the auditory intensity experiment will be batch averaged.&lt;br /&gt;
&lt;br /&gt;
Please note that there are further tutorials covering this experiment. The first file is contaminated by many eyeblinks, and more epochs would be averaged if eye correction were used (see Viewlet demonstration on artifact correction on the BESA website). However, in this tutorial we will just use artifact rejection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Various ways of creating a File List'''&lt;br /&gt;
&lt;br /&gt;
1. '''Files that were open in BESA Research are automatically added to the File List.''' Start BESA Research and open the files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt '''&amp;lt;/span&amp;gt;in the directory ''Examples\ERP-Auditory-Intensity''.&lt;br /&gt;
&lt;br /&gt;
2. Select ''Process / Batch Scripts''.... You should see the file names in the '''''File List Tab''''' something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. You can resort the files in the file list alphabetically by clicking onto the '''''File List column header''''':&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can mark any file, hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;key and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrow '''&amp;lt;/span&amp;gt;to move the file name up or down the list. This is the sequence in which files will be processed in the batch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; and save the list you have created to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Highlight both names and press the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
6. '''Files can be dragged from Windows Explorer'''. Start Windows Explorer and navigate to the ''ERP-Auditory-Intensity'' subdirectory of your BESA Research examples folder (located in the ''Public Documents'' folder of your computer). Click on &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and drag it with the mouse onto the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''''File List Tab'''''. Let go of the mouse. BESA Research opens the file, and displays the name in the File List. Repeat for &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt.'''&lt;br /&gt;
&lt;br /&gt;
7. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
8. '''Files can be added using the ''Add File'' button'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; and navigate to the ''Examples\ERP-Auditory-Intensity'' subdirectory. Select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt;. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl'''&amp;lt;/span&amp;gt; and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;. Both names should then be displayed in the ''File Open'' dialog. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to add the files to the file list.&lt;br /&gt;
&lt;br /&gt;
9. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
10. '''Files can be loaded from a previously saved file list'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List '''&amp;lt;/span&amp;gt;and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;, the list you saved in step 6 above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Setting up the batch'''&lt;br /&gt;
&lt;br /&gt;
1. We will add three commands, '''Paradigm''', '''Artifact Scan''', and '''Average''', to create a batch that will be applied to the two files in the file list.&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''Batch Tab'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button to obtain the ''Select Command'' window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (9).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt; and then on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; (alternatively, double-click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt;). Hit &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Browse'''&amp;lt;/span&amp;gt;, navigate to the ''Auditory'' folder, and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''AEP_Intensity.pdg'''&amp;lt;/span&amp;gt;, the paradigm for the auditory intensity experiment.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (10).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to obtain the ''Load Paradigm Task'' window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (11).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;, and the first task in the batch is ready, and listed in the Batch Command window. If you want to modify the command, double-click on it to open the above window, that allows to browse for a different paradigm file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (12).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Next, we add the '''Artifact Scan''' command. Click on the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select ''Artifact Scan.''&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (13).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Artifact Scan Task'' window. We want to be able to view the results of the scan, and adjust thresholds and bad channels if necessary. Therefore, check the ''Wait after scan'' checkbox.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (14).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to close the ''Artifact Scan Task'' window. Our batch now contains two commands.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (15).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Finally, we will add an '''Average''' command. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button and select ''Average''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Average Task ''window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (16).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. With the default settings, the average would be saved to the same directory as the data. The file name mask is set by default so that in this example the two averages would be saved to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1-av.fsg '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2-av.fsg'''&amp;lt;/span&amp;gt;. We will save the averaged files to subdirectory ''&amp;quot;Averages''&amp;quot; of the data directory. Uncheck the ''Use default target'' check box, change the File name mask to '''%basename%_av-test''' in order not to overwrite the predefined files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (17).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Average Task'' window. Our batch is now complete.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (18).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
13. We will now save the batch so that it can be used again. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt; button, and save to the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-ex1.bbat'''&amp;lt;/span&amp;gt;. Note that an easy way to generate new averaging batches is to load a previously save batch and edit the commands -- it may only be necessary to edit the '''Paradigm''' command to select the relevant paradigm file, and maybe to adjust the target directory in the '''Average''' command.&lt;br /&gt;
&lt;br /&gt;
14. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch'' Window to start the batch running. As requested, the batch pauses after the artifact scan:. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (19).gif]]&lt;br /&gt;
&lt;br /&gt;
You may now adjust the number of rejected trials, e.g. by moving the vertical red bar to the left, or exclude bad channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to continue with averaging.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (20).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
16. Note that, in the background, the ''Batch Running'' window is providing feedback about the current file and current task.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
17. The batch will stop again after the next artifact scan. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to allow the batch to run to the end.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (21).gif|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
18. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log'''&amp;lt;/span&amp;gt; to view the batch protocol. If you are using Internet Explorer or Netscape family (Mozilla, Firefox) browsers, and JavaScript is enabled, you will first see just batch titles defined by the date and time the batch was started. The most recent title is at the top of the list. For other browsers, or if JavaScript was not enabled, all protocol texts are expanded as in 19 (below).&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (22).gif|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
19. Click on the first title to expand its protocol. Here, for example, the protocol gives feedback about the number of epochs that were averaged for each file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (23).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
20. Finally, press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to return to the main BESA Research display. Open the averages in the ''Averages'' subdirectory to confirm that they were generated properly.&lt;br /&gt;
&lt;br /&gt;
=== Example: Merging files using the Export Command ===&lt;br /&gt;
&lt;br /&gt;
Here we will demonstrate the use of the '''Export '''command to merge two files. We will combine the two averages from the previous example (Data averaging in the auditory intensity experiment) into one target file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Generate the file list'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and load the two data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av-test.fsg'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2_av-test.fsg'''&amp;lt;/span&amp;gt; that were saved in the previous example.&lt;br /&gt;
# Select ''Process / Batch Scripts....''The two file names should be displayed in the file list.&lt;br /&gt;
# In the file list, make sure that &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1_av-test.fsg '''&amp;lt;/span&amp;gt;is the first file in the list. If it is not, highlight the file, and move it up using &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl+up'''&amp;lt;/span&amp;gt;, or right click and select ''Move Up'' in the context menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Generate the batch'''&lt;br /&gt;
&lt;br /&gt;
1. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select the '''Export''' command.&lt;br /&gt;
&lt;br /&gt;
2. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Export Task'' window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (24).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt;... button to open the ''Export Dialog''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (25).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Since we are combining averages, select ''Hires (no compression)'' in the '''Target data format''' drop-down list (If we were merging raw data files, it is better to select compression. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the dialog. Check'' Append if file already exists'', so that the files will be merged. Enter '''s1+s2''' in the target file name mask edit box. This ensures that both files will be saved to the same target: &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (26).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Export Task'' window. The '''Export '''command is displayed. &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (27).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Optionally, you may save the batch file by pressing &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
7. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch, and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch Completed'' window to return to the BESA main window.&lt;br /&gt;
&lt;br /&gt;
8. Finally, open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt; to confirm that it contains the two merged files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Merge raw data'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Repeat the above task to merge the two raw data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2.cnt'''&amp;lt;/span&amp;gt; into a single target file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.foc'''&amp;lt;/span&amp;gt;. In this case, select one of the compression options as the target data format. Note that you would not normally want to merge two files from different subjects. However, several data blocks from the same subject can conveniently be merged using this method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; files can also be merged using the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''Combine Conditions''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; dialog. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions, Channels ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Combine Condition Scripts ===&lt;br /&gt;
&lt;br /&gt;
With the Combine-Conditions module you can do a variety of operations on BESA averages (files with the extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, and other segment files, such as &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.mul&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.swf&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* Create grand averages&lt;br /&gt;
* Combine averages (add, subtract, weighted/unweighted)&lt;br /&gt;
* Merge files&lt;br /&gt;
* Exclude unwanted averages&lt;br /&gt;
* Rename conditions&lt;br /&gt;
* Rename or resort channels&lt;br /&gt;
* Generate averages or differences over selected channels&lt;br /&gt;
* Transform the data: standard interpolated 81 electrodes, change sampling rate, change interval&lt;br /&gt;
* Determine peaks, mean amplitudes, or integrals on data averages&lt;br /&gt;
* These operations can be performed on one or more files simultaneously. Results of an operation are stored in a single target file.&lt;br /&gt;
&lt;br /&gt;
The module includes four tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* File List: Define a list of files on which the operations will be performed.&lt;br /&gt;
* Condition List: List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
* Channel List: List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
* Run Scripts: Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak analysis). Start the operation.&lt;br /&gt;
* Note that in all four tabs, configurations can be saved for future use, and the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button restores the most recently used configuration.&lt;br /&gt;
&lt;br /&gt;
=== Condition List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
&lt;br /&gt;
The first column of the&amp;amp;nbsp;list box shows a list of all the condition names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the source conditions. Columns define the target conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each condition name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target conditions will have the same name as source conditions. Right click on source condition labels to view properties (e.g. no. of samples, time range, sampling rate).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (28).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the condition list'''&lt;br /&gt;
&lt;br /&gt;
* Target condition names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: conditions can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over conditions, the sum is divided by the number of conditions, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;''Divide the result by the sum of PLUS factors''&amp;quot; is unchecked, the conditions will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between conditions, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the condition list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Weighting of averages'''&lt;br /&gt;
&lt;br /&gt;
* Below the list, click on the ''Weighted Average'' row to toggle &amp;quot;YES&amp;quot; and &amp;quot;NO&amp;quot;. &amp;quot;YES&amp;quot; means that averages will be weighted by the number of epochs contributing to the average. For instance, if average A contained 100 epochs and average B contained 200 epochs, the weighted average will be computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(100 * A + &amp;amp;nbsp;200 * B) / (100 + 200)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Select &amp;quot;NO&amp;quot; for an unweighted average. For the above example, the average is computed as&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(A + B) / 2&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Weighted averages are not permitted if one of the boxes contains a negative value.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Values other than +1 or -1 in the boxes apply a different kind of weighting. For instance, we want to compute the difference between the means of conditions A, B, C and D, E. Use a right-click to specify the fraction 1/3 for each of A, B, and C, and -1/2 for each of D and E (see example below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (29).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Feedback'''&lt;br /&gt;
&lt;br /&gt;
* Conditions that have different numbers of electrodes (averaging across different files) can only be combined if channels are interpolated to a standard set of electrodes.&lt;br /&gt;
* Conditions that have different durations or sampling rates can only be combined if the sampling rate and durations are made the same.&lt;br /&gt;
* Feedback about the above situations is displayed by the presence of tick marks above the list box.&lt;br /&gt;
&lt;br /&gt;
=== Channel List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
&lt;br /&gt;
Note that this tab is very similar in usage to the '''Condition List Tab'''. Note also that some of the functions performed in this tab could also be done in the Montage Editor. It may be a matter of convenience whether you choose to perform these operations here or in the Montage Editor.&lt;br /&gt;
&lt;br /&gt;
The first column of the list box shows a list of all the channel names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the ''source'' channel. Columns define the'' target'' channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each channel name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target channel will have the same name as source channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Combining files'''&lt;br /&gt;
&lt;br /&gt;
If files with different channel configurations are included in the File List, the rows and columns of the Channel List Tab will only contain the labels for the channels that are in common among the files.&lt;br /&gt;
&lt;br /&gt;
If the files in the File List have a different sequence of channels, the sequence of the first file in the list will be adopted in the Channel List.&lt;br /&gt;
&lt;br /&gt;
Thus, for the initial setting, unless the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked, the target grand average or peak/amplitude analysis, etc. will be applied using only channels that are in common among the input files, and using the channel sequence of the first file in the File List. By changing the target channels or by changing the entries in the Channel List, new channels consisting of averages or differences can be generated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''What can the Channel List be used for?'''&lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
&lt;br /&gt;
* Reorder or relabel channels&lt;br /&gt;
* Create channel differences&lt;br /&gt;
* Create averages over channel groups, e.g. for peak analysis&lt;br /&gt;
* Extract a selection of channels for peak analysis or mean amplitudes&lt;br /&gt;
* Create grand averages across files with different channel configurations, just using channels in common among the files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (30).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the channel list'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Target channel names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: channels can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over channels, the sum is divided by the number of channels, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;Divide result by the sum of PLUS factors&amp;quot; is unchecked, the channels will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between channels, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the channel list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Channel List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Channel List&amp;amp;nbsp;'''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
=== Run Scripts Tab ===&lt;br /&gt;
&lt;br /&gt;
Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak detection. Start the operation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load or Save Settings'''&lt;br /&gt;
&lt;br /&gt;
* You can save the current settings of this tab to a file (*.run) which can be loaded later.&lt;br /&gt;
* When you run the script, the current settings are saved automatically to a file &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* Press this button to load the previous settings (from &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Averages to Generate'''&lt;br /&gt;
&lt;br /&gt;
* '''Generate separate averages for each source file'''. Averages are performed over conditions within the source file, and are then appended to the target file.&lt;br /&gt;
* '''Combine data from source files'''. Conditions are combined over all source files into a single target average.&lt;br /&gt;
* '''No averages, just copy'''. Files are copied and merged to the target file. Use this option for renaming conditions, merging files, removing unwanted averages (see below), changing the sampling rate and interval.&lt;br /&gt;
* '''Peaks and mean amplitudes'''. Specify time ranges for peaks, mean amplitudes, or integrals (areas).&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note: When generating or copying averages (first three options), filters and baseline settings are turned off. For Peaks and mean amplitudes, filters and baseline settings are specified in the dialog.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Spatial Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Interpolate to Standard 81 electrodes'''. The target file will contain only electrodes (other channels are omitted), using the Standard 81 configuration (as in other export functions within BESA Research). This cannot be selected if the source data contain less than 16 EEG channels.&lt;br /&gt;
* '''Interpolate Bad Channels'''. Bad electrode channels in the source file will be interpolated. If the above option is deselected and bad channels exist in one or more of the source files, this option is always on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;BESA Research can interpolate EEG, and MEG if the sensors are axial gradiometers or magnetometers. If other channels are marked as bad in one or more of the source files, these will be defined as bad in the target file. This applies to MEG planar gradiometers, to polygraphic data, and to ICR channels.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Temporal Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Spline to New Sampling Rate and Interval'''. Data can be converted to a new sampling rate, and the interval can be changed.&lt;br /&gt;
** If the sampling rate is reduced, the data will be low-pass filtered at 1/3 sampling frequency before reduction.&lt;br /&gt;
** If the sampling interval is changed, the prestimulus and poststimulus intervals are limited by the smallest intervals in the conditions contributing to the averages. These limits are shown below the edit boxes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks and Mean Amplitudes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (31).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range between which peaks are to be determined.&lt;br /&gt;
* Select the montage on which the peaks are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Define the baseline settings.&lt;br /&gt;
* Specify whether peaks are to be defined at one latency: if so, select the channel on which peaks are to be detected.&lt;br /&gt;
* Specify whether you want to find positive or negative peaks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Mean amplitudes and areas:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range over which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Select the montage on which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Note that when computing areas, data are first rectified (made positive) and then summed over the time range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Output options of the analysis:'''&lt;br /&gt;
&lt;br /&gt;
* A single ASCII file that contains the result of the analysis for all data sets, conditions, and channels including header and information lines.&lt;br /&gt;
* A sparse output suitable for import in SPSS. Each variable (e.g. a latency, a channel amplitude) constitutes one column of the output file.&lt;br /&gt;
* Direct transfer to MATLAB into a struct besa_peak. For more information on the data transfer from BESA Research to MATLAB, please refer to help chapter ''“The MATLAB interface”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Starting the Operation'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;to start the operation. After the operation is completed, and the &amp;quot;Open target file in BESA&amp;quot; box is checked, BESA Research will open the target file. &amp;amp;nbsp;&amp;quot;Open target file in BESA&amp;quot; cannot be checked if &amp;quot;Peaks and mean amplitudes&amp;quot; was selected - then the result of the operation will be an ASCII file or a MATLAB transfer.&lt;br /&gt;
* You will be asked for the name of the target file (unless a MATLAB transfer of peak data has been performed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Restrictions'''&lt;br /&gt;
&lt;br /&gt;
* Depending on source file configurations, not all options above are selectable. For instance, if two files contain different numbers of electrodes, and the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked in the '''''Channel List''''' Tab, spatial interpolation to Standard 81 is enforced in the target. Similarly, if different sampling rates are used in different files, temporal interpolation is enforced.&lt;br /&gt;
* You are not allowed to add files to the file list if the channel configuration is different, and the data cannot be combined with Standard 81 interpolation. Since Standard 81 interpolation is only possible for EEG, multiple files without EEG can only be loaded if they have the same number of channels.&lt;br /&gt;
&lt;br /&gt;
=== How to Create Grand Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to average in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To average across different conditions, click in the list boxes to obtain &amp;quot;+1&amp;quot; for each source condition to combine, and rename the target condition to define a meaningful name for the average.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Generate Differences Between Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To create differences, click in the list boxes to obtain &amp;quot;+1&amp;quot; for one of the source conditions, and &amp;quot;-1&amp;quot; for the source condition to subtract, and rename the target condition to define a meaningful name for the difference.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. An average of the differences is generated. If only one example of each condition exists, e.g. in a grand average file, the result is the difference between conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Merge Files ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to merge in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notes'''&lt;br /&gt;
&lt;br /&gt;
* If the source files have different electrode configurations, use the Standard 81 configuration for the target.&lt;br /&gt;
* If the source files have different sampling rates or intervals, use Temporal Interpolation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Remove Unwanted Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted segments'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as averages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted conditions (by label)'''&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Deselect the target conditions you want to omit (replace the &amp;quot;+1&amp;quot; by a blank).&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as artifacts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Rename Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. Click on column headings to rename the target conditions.&lt;br /&gt;
* Click on the''' Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data with the renamed conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Change the Sampling Rate ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file(s) you want to change in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...'').&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Select &amp;quot;''Spline to New Sampling Rate and Interval''&amp;quot; and type the new sampling rate into the edit box.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Create grand average and combinations of conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, we will generate a grand average of the results of the Auditory Intensity Experiment. The experiment includes averages from five different stimulus intensities. We will create a grand average over each intensity, but also include means over the two lowest and the two highest intensities, and the difference between these two combinations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av.fsg - S10_av.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The files contain the individual averaged data of the 10 subjects who participated in this study.&lt;br /&gt;
# Select ''ERP / Combine Conditions...'' The file list should display the two files, with feedback about the number of averages and conditions. 8 epochs are found. See the ''“Data averaging in the auditory intensity'' ''experiment”'' example for examples how to manipulate the file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (32).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. The initial window defines target conditions with the same name as the source conditions. To generate the grand average over these conditions we could proceed without further changes to the '''Run Scripts Tab'''. However, we want to modify the condition list and create a condition that contains the grand averaged difference between the''' High''' and '''Low''' conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''All '''column label. In the resulting window, rename condition '''All''' to''' Difference'''. Then press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (33).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. The last column is now labeled '''Difference.''' Left-click twice onto the ‘'''+1’''' entry that links this condition to the '''All '''input condition. This will remove the link and leave the field blank. To define the ‘Difference’ condition as the average of ‘High’ minus ‘Low’ over subjects, left-click once into the field linking input '''High''' with target '''Difference''' to generate an entry ‘'''+1’''' in this field. Left-click twice into the field linking input '''Low '''with target '''Difference''' to generate an entry '-'''1'''’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;[[Image:Batch processing (35).gif]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; and save the list to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ER&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;P-aud-ex1.clist'''&amp;lt;/span&amp;gt;. This condition combination can thus be loaded later using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Click on the '''Run Script Tab'''.&lt;br /&gt;
# The default tab settings are ready for generating the grand average ('''Combine data from source file''' and '''Open target file in BESA''' should be checked). Just press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Enter &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_cc-test.fsg'''&amp;lt;/span&amp;gt; as file name and press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Save'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The resulting file contains the 8 target conditions, 60db, 70dB, 80dB, 90dB, 100dB, Low, High, and Difference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Average files from different experiments ===&lt;br /&gt;
&lt;br /&gt;
This example is intended to illustrate several features of the ''Combine Conditions'' Dialog, such as electrode interpolation and resampling. We will combine an average from the Auditory Intensity experiment with one from the P300 auditory experiment. In this particular case, it is not a very meaningful thing to do, but it shows what is possible. For instance, the same experiment may have been performed using different sampling rates or electrode combinations. This example shows how such data may be combined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_GA.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The file contains the grand average data from the auditory intensity experiment.&lt;br /&gt;
# Open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''RareFrequentResponseLeft.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-P300-Auditory'' folder. This file contains averages from the P300 auditory experiment.&lt;br /&gt;
# Select ''ERP / Combine Conditions... ''Note that the files have different sampling rates and different numbers of electrodes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (36).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. Note that the feedback text at the bottom of the window displays the text &amp;quot;Standard 81 interpolation required to generate average; Across files: resampling or change in time range required to generate average&amp;quot;. The condition labels show all the names from both files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (37).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.  We will exclude most conditions, and just combine the most similar conditions from the two experiments: the &amp;quot;Standard&amp;quot; and the &amp;quot;80dB&amp;quot; conditions. Click on the title of the first column,''' Blink'''. Select “''Delete all conditions to the right of this column”'', and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (38).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on the title again, and rename the target condition to &amp;quot;Standard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (39).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click twice in the first line to remove the &amp;quot;+1&amp;quot; entry there. Click once in the third row (&amp;quot;Frequent&amp;quot;), and in the 7th row (&amp;quot;80dB&amp;quot;), to display &amp;quot;+1&amp;quot; at each entry. Thus, just two of the conditions will be combined into one target condition.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (40).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Run Script Tab'''. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (41).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Note that '''Interpolate to Standard 81 electrodes''' is checked and grayed: since two different electrode sets are to be combined, we can only do this by interpolating electrodes. Also, both '''Spline to new sampling rate''' and '''Clip interval '''are checked and grayed. Again, these settings are required in order to be able to average the two data files together. The sampling rate is set to the higher of the two selections. The time range is set to the largest possible range that can be clipped from the two data sets. For now, leave these settings as they are, and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Save the target to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''TestCombineExpts_CC-std81.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing</id>
		<title>BESA Research Batch Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing"/>
				<updated>2021-05-05T13:19:05Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = BESA Research 6.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==  Batch Processing and Combining Conditions == --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions and Batch Module: Introduction ==&lt;br /&gt;
&lt;br /&gt;
Functions of this module are started by selecting the menu operations &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Combine Conditions...'''&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Batch Scripts...'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''Combine Condition Scripts''' provides various operations on BESA averages.&lt;br /&gt;
* '''Batch Scripts''' provides batch operations on all data files.&lt;br /&gt;
* Note that a batch script can also be performed on the current file by selecting &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Run Batch...'''&amp;lt;/span&amp;gt;&amp;quot; or by typing the shortcut key &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''R'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== File List Tab ==&lt;br /&gt;
&lt;br /&gt;
Define a list of files on which the operations will be performed. The tab is the same for Combine Conditions Scripts and for Batch Scripts. Combine Conditions Scripts only allows you to open BESA average files (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, but also &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.raw'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.swf'''&amp;lt;/span&amp;gt;, and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt; if the files have a defined pre-stimulus interval), whereas Batch Scripts allows you to open any data file whose format is known to BESA Research.&lt;br /&gt;
&lt;br /&gt;
When the Combine-Conditions or the Batch module is started, all currently opened (Combine-Conditions: averages only) files are displayed in the list.&lt;br /&gt;
&lt;br /&gt;
To the right of each file name, the number of electrodes, total number of channels, and the sampling rate used in the file are displayed. In the Combine-Conditions module, the number of Epochs (segments) and the number of differently-named conditions are also shown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add files to the list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File '''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
* Drag one or more files from Windows Explorer onto the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Remove files from the list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and confirm the delete operation in the resulting dialog.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key to mark multiple files). Right click to obtain the context menu and select &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;quot;, or just press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Reorder files within the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctr'''&amp;lt;/span&amp;gt;l key to mark multiple files). Right click to obtain the context menu and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;, or hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key '''and '''press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrows'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sort the current file list alphabetically'''&lt;br /&gt;
&lt;br /&gt;
* Click on the File bar above the list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List'''&amp;lt;/span&amp;gt; button, or the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button to load the most recently used file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Which conditions are read from a source file? (Combine-Conditions module only)'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File list from Combine Conditions:'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (1).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Don't try to open here... (Batch only)'''&lt;br /&gt;
&lt;br /&gt;
By default, this checkbox is unchecked.&lt;br /&gt;
&lt;br /&gt;
In the checked state, BESA Research doesn't check if it can open the file. Use this function '''only''' if the file is ASCII and you want to use the '''ImportASCII '''batch command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File List from Batch Scripts''':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (2).png]]&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Batch Processing &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== Batch Processing Scripts ===&lt;br /&gt;
&lt;br /&gt;
With Batch Scripts, you can define a set of operations (e.g. Artifact Scan, Average, etc.) and apply these to several data files.&lt;br /&gt;
&lt;br /&gt;
These operations include&lt;br /&gt;
&lt;br /&gt;
* Load Paradigm&lt;br /&gt;
* Artifact Scan&lt;br /&gt;
* Average&lt;br /&gt;
* Export (and Merge)&lt;br /&gt;
* File Open (switch to another data file)&lt;br /&gt;
* Set filters&lt;br /&gt;
* Specify a montage (used, for example, for export to current montage)&lt;br /&gt;
* Run automatic eye and EKG artifact correction&lt;br /&gt;
* Define artifact topographies&lt;br /&gt;
* Turn artifact correction and view on and off&lt;br /&gt;
* Read and write events&lt;br /&gt;
* Edit default block epoch (for export around triggers)&lt;br /&gt;
* Edit triggers (for export around triggers)&lt;br /&gt;
* Mark a block for export, or send the block to Source Analysis or Top View&lt;br /&gt;
* Convert patterns to triggers&lt;br /&gt;
* Attach auxiliary files (e.g. elp, sfp) to the data file&lt;br /&gt;
* Send to MATLAB&lt;br /&gt;
* Specify display configurations for the BESA Research Main, SA, and Top View windows&lt;br /&gt;
* and more - see the full list of [[#Batch Commands|Batch Commands]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An additional set of commands are available for operations in the '''Source Analysis Module''', allowing to load, create and fit dipole models, and save the results.&lt;br /&gt;
&lt;br /&gt;
A further set of commands apply to '''Time-Frequency Analysis''', allowing to start TFC, change the display, save results, and run the beamformer or DICS analyses on a selected time-frequency range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
These operations will be extended in future program releases.&lt;br /&gt;
&lt;br /&gt;
The module includes two tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* '''File List''': Define a list of files on which the operations will be performed.&lt;br /&gt;
* '''Batch''': Define or load '''batch commands'''. Run the batch.&lt;br /&gt;
&lt;br /&gt;
=== Batch Tab ===&lt;br /&gt;
&lt;br /&gt;
Load or define batch commands, and then apply them to the files in the File List.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add Command'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; to add a new command to the batch. The following dialog is opened, showing the available commands:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Select the desired command and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; or double-click on the command. A dialog box is opened, allowing to specify individual command parameters.&lt;br /&gt;
* If you click on &amp;quot;Apply at beginning of batch&amp;quot; or &amp;quot;Apply at end of batch&amp;quot;, the command will only be run at the beginning or the end of a batch. You can use this, for example, at the end of a batch to start a MATLAB script to perform statistics on the results of the batch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load and Save Batch'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load a previously defined batch or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to save the current batch to a file (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.bbat&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load the most recently used batch file. Whenever a batch is run, the current set of commands is written to the file &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Previous.bbat in'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Scripts/Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; subdirectory. This file is loaded when you press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Clear All'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Clears all commands from the window.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''View Log File'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Each time a batch is run, BESA Research adds information about the batch to a log file, with headings showing the date and time the batch was started. The file is opened automatically in Internet Explorer if errors occurred during processing. Otherwise you may open the file by &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button here or in the dialog that is displayed at the end of batch processing. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The log file is saved in xml format, and a JavaScript is used to format the display in web browsers. JavaScript should be enabled in the browser to obtain an optimal display of the results. If JavaScript is enabled, the log file is displayed as a list of headings for each batch. Click on a heading to display the results of the corresponding batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;To open the log file in the Notepad, hold the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Shift '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;key down when pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Batch Command List'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Double-click on a command to edit it. See &amp;lt;/span&amp;gt;[[#Batch Commands|Batch Commands]]&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for descriptions of the dialogs that are opened to edit each command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Right click on a command to open a context menu allowing more options.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Move Up'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''and Move Down'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; can also be applied to multiple selections.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If you have made a multiple selection, the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button will delete all the marked commands. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;plus &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''cursor keys'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will move the marked commands up or down.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Comment'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove a semicolon (;) in front of the command, to deactivate or reactivate the command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Command Only at Start/End'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove the text &amp;quot;Start_&amp;quot; or &amp;quot;End_&amp;quot; in front of the command. With these prefixes, the command will only be performed when the first file (&amp;quot;Start_&amp;quot;) or the last file (&amp;quot;End_&amp;quot;) in the file list is being processed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Single Step Mode'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Check this item to step through the batch, one command at a time. A dialog is opened after each command, allowing to run the next command, continue the batch without single steps, or stop running the batch. See the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'' “Pause''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;” command for further details.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;During a batch, press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changes in batch written to database'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Checked by default. If this item is unchecked, file display settings, such as Montage setting and Artifact correction display, are not written to the database. When the file is next opened in BESA Research, the settings made in the batch are not retained.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Leave files in the file list open after running the batch'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If this item is checked, files in the file list will remain open after the batch. This is useful, for instance, if you want to open a set of files, specifying the same montage and/or filter settings for each file.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to start running the batch. Each command is then applied in succession to each file in the File List.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that, while a batch is running press and hold down the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The log file ===&lt;br /&gt;
&lt;br /&gt;
A protocol of each batch is written to the log file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Scripts/Log/Batch.xml.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File '''&amp;lt;/span&amp;gt;button, the file is opened in your default browser for xml files. The file will be opened automatically if there was an error during batch processing unless you have used the ''BatchError'' batch command to suppress this behaviour.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''DHTML formatting of the log file'''&lt;br /&gt;
&lt;br /&gt;
The xml file is formatted using JavaScript (Dynamic HTML). If JavaScript is enabled in your browser, you will first see a list of batch protocol titles, labelled by the date and time at which the batch was started. The most recent batch is at the top of the list.:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).png|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the title to view the protocol for the corresponding batch:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''JavaScript and XP Service Pack 2'''&lt;br /&gt;
&lt;br /&gt;
By default, if the log file is opened in Internet Explorer after XP Service Pack 2 has been installed, IE will warn you with the message: &amp;quot;''To help protect your security, Internet Explorer has restricted this file from'' ''showing active content that could access your computer&amp;quot;.'' All the protocols in the log file are displayed. You may safely click on the options to allow active content in the log file, if you want to display the file as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Backup of the log file'''&lt;br /&gt;
&lt;br /&gt;
When the log file is written, a backup of the previous version is written to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml.bak'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the size of the log file exceeds 200 KB, it is renamed to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml_date_time'''&amp;lt;/span&amp;gt; (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.xml_2004-10-08_10-53-32'''&amp;lt;/span&amp;gt;), and a new version of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml'''&amp;lt;/span&amp;gt; is created.&lt;br /&gt;
&lt;br /&gt;
=== Placeholders ===&lt;br /&gt;
&lt;br /&gt;
A powerful feature of the batch commands is the ability to define file names and specify standard paths using placeholders. These are text strings enclosed by percentage (%) signs. They can be used in all batch commands where file names are specified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Basename'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Placeholder !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; width=&amp;quot;10%&amp;quot;|'''%basename%'''&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|replaced by the basename of the currently opened file.&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%basename-n%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the last &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%-nbasename%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the first &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasename%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list (it has the same meaning as %basename% if no MAINFileOpen batch command was used in command list)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%base%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file without the path&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbase%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list without the path&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%ext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%basefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%t%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: time since start of batch on current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%T%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: current date and time&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%label%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Replace label of the most recent marked block by the block label, not including no. of averages&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%LABEL%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
| Replace label of the most recent marked block by the block label, including no. of averages&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%scripts%'''&lt;br /&gt;
|replaced by the path to the Scripts folder.&lt;br /&gt;
|&amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard MATLAB scripts used by BESA Research.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%montages%'''&lt;br /&gt;
|replaced by the path to the Montages folder.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%examples%'''&lt;br /&gt;
|replaced by the path to the Examples folder.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''%basename%''' -- replaced by the basename of the data file in the File List. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''%basename-n%''' -- replaced by the basename of the data file in the File List, but removing the last &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%-nbasename%''' -- replaced by the basename of the data file in the File List, but removing the first &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%scripts%''' -- replaced by the path to the Scripts folder (e,g, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard Matlab scripts used by BESA Research).&lt;br /&gt;
&lt;br /&gt;
* '''%montages%''' -- replaced by the path to the Montages folder.&lt;br /&gt;
&lt;br /&gt;
* '''%examples%''' -- replaced by the path to the Examples folder.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Placeholders for folders'''&lt;br /&gt;
&lt;br /&gt;
The following placeholders are the same as those used in the [Folders] section of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Besa.ini'''&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The strings enclosed by percent signs (%) are placeholders for the following folders in English-language versions of Windows. Folder names are different for the system and for other language settings. BESA Research will substitute the placeholders by the appropriate folder name for the Windows system and the system language:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 10 (English)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%localapp%''' = &amp;quot;&amp;quot;C:\Users[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;&amp;quot;Desktop[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%publicprog%''' = &amp;quot;Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;&amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Desktop\[User]\Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir%'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 7 (English):'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%localapp%''' = &amp;quot;C:\Users\[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;Desktop\[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%publicprog%''' = &amp;quot;C:\Users\Public\Public Documents\BESA\Research_7_1&amp;quot;. This folder is directly accessible from the Windows Explorer under &amp;quot;Libraries\Documents\Public Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;&amp;quot;Libraries\Documents\My Documents\Research_7_1&amp;quot; or &amp;quot;Desktop\[User]\My Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir% &amp;amp;nbsp;'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Batch Commands ===&lt;br /&gt;
&lt;br /&gt;
Batch commands are selected when the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt;&amp;quot; button is pressed in the &amp;quot;Batch&amp;quot; Tab. The commands are subdivided into five categories: General commands, commands for the Main module, for the Source Analysis module, imaging commands in the Source Analysis module, and commands for Time-Frequency Analysis. The commands have prefixes,''' GEN''', '''MAIN''',''' SA''', '''SAIMAGE''', and''' TFC'''), which identify the category. For compatibility with older program versions, old batches without the prefixes are accepted.&lt;br /&gt;
&lt;br /&gt;
Detailed descriptions of each batch command are available in the electronic help chapter “''Batch Processing and Combining Conditions / Batch Processing / Batch Commands”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands''' - prefixed with &amp;quot;'''GEN'''&amp;quot; (can be used anywhere):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot; style &lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| GENBatchError || used to change program behavior when errors occur&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENBatchWindowPosition&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the position of the batch window relative to the main window&lt;br /&gt;
|-&lt;br /&gt;
| GENComment || comment in the batch script: no batch functionality&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABcommand || send a command string to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABwaitForVariable || tells BESA to wait until Matlab has created a variable with the specified name.&lt;br /&gt;
|-&lt;br /&gt;
| GENPause || pause batch operations, allowing step-by-step operations&lt;br /&gt;
|-&lt;br /&gt;
| GENFor/GENEndFor|| a programming language-like FOR loop&lt;br /&gt;
|-&lt;br /&gt;
| GENRunProcess || runs a command-line process, e.g. an external program to perform part of the data analysis in the batch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENsaveBitmap&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SetVariable&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the value of the variable is inserted into subsequent batch commands where the text contains the name flanked by % signs&lt;br /&gt;
|-&lt;br /&gt;
| GENWindowPosition || set window size and positions to a selection of standard settings, e.g. for bitmap export&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for the Main Module''' - prefixed with &amp;quot;'''MAIN'''&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| MAINArtifactCorrect || run automatic artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactMethod || specify the method for artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactOn || turn artifact correction an artifact view on or off&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifact Scan || run an artifact scan as from the Paradigm Dialog&lt;br /&gt;
|-&lt;br /&gt;
| MAINAuxiliaryFiles || associate auxiliary files (e.g. *.''ela'', *.''sfp'') with the data file&lt;br /&gt;
|-&lt;br /&gt;
| MAINAverage || average the data&lt;br /&gt;
|-&lt;br /&gt;
| MAINBaseline || specify the parameters for baseline correction&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINDefineArtifactTopography&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || define an artifact topography&lt;br /&gt;
|-&lt;br /&gt;
| MAINEditDefaultEpoch || edit the default block epoch&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventRead || read events from an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventWrite || write events to an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINExport || export or append data in the selected target format&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINExportToBESAConnectivity&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || export data segments to BESA Connectivity&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFT || calculates the FFT spectrum of the marked data interval&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTmean || starts an averaging procedure that calculates the mean spectral properties in pre-defined regions&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTsave || saves FFT data (generated using the ''FFT Average option'' in the ''Average ''command) to disk (*.''fma)''&lt;br /&gt;
|-&lt;br /&gt;
| MAINFileOpen || close the current file and open a new file to which the remaining batch commands will be applied&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINFileClose&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || close the currently open file in a batch, provided it is not the current file in the File List&lt;br /&gt;
|-&lt;br /&gt;
| MAINFilter || set filters&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINfMRIArtifact&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns on the fMRI artifact removal&lt;br /&gt;
|-&lt;br /&gt;
| MAINGoTo || jumps with the cursor to the specified time point&lt;br /&gt;
|-&lt;br /&gt;
| MAINICA || starts ICA decomposition of data on the current screen &lt;br /&gt;
|-&lt;br /&gt;
| MAINICAsave || saves selected ICA components as topographies in a file&lt;br /&gt;
|-&lt;br /&gt;
| MAINICAselect || opens component selection dialog for managing ICA components&lt;br /&gt;
|-&lt;br /&gt;
| MAINImportASCII || import an ASCII file into a ''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'' file.&lt;br /&gt;
|-&lt;br /&gt;
| MAINMarkBlock || mark a data block (optionally send to Source Analysis)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMarkChannels&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || mark one or more channels, as given by the list&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMaxInInterval&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || within the current marked block, search for the largest absolute value on the specified channel&lt;br /&gt;
|- &lt;br /&gt;
| MAINMontage || change the montage (used by the Export command when saving to current montage)&lt;br /&gt;
|-&lt;br /&gt;
| MAINParadigm || load a paradigm file&lt;br /&gt;
|-&lt;br /&gt;
| MAINPatternToTrigger || convert a tag into a trigger&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINPolygraphicFilters&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || sets filters for polygraphic or added channels&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINScale&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set amplitude and time scales&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSearchAverageView&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start search average view&lt;br /&gt;
|-&lt;br /&gt;
| MAINSendToMATLAB || send data to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSplineConstant&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the spline constant used in spherical spline maps and channel interpolation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerRecode&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the command recodes a specified trigger number to a new number&lt;br /&gt;
|-&lt;br /&gt;
| MAINTriggerSelect || edit the trigger list (cf. ''Edit / Trigger Values''...)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerTagDelete&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || delete one or more triggers or tags&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewAverageBuffer&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turn on the Average Buffer View and place the specified buffer number to the left in the display&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewChannelType&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || select the channel type to display, and select channel types for mapping, export, etc&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewSelected&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns selected view on or off&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands for Source Analysis''' - prefixed with &amp;quot;'''SA'''&amp;quot; (but see also ''MarkBlock'', which is used to send a block of data to SA and open the SA window):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| SAAddSource || add a dipole or regional source to a model&lt;br /&gt;
|-&lt;br /&gt;
| SAChannelTypeForFit || switch between EEG, magnetometers or axial gradiometers, and planar gradiometers&lt;br /&gt;
|-&lt;br /&gt;
| SAConvertSource || convert a source from dipole to regional source, or from regional source to dipole&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalClara || run Cortical CLARA&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalLoreta || run Cortical LORETA&lt;br /&gt;
|-&lt;br /&gt;
| SADelete || delete current solution or all solutions or remove current fit interval or cursor&lt;br /&gt;
|-&lt;br /&gt;
| SADICS || start DICS computation (if DICS has been precomputed in the time-frequency image command)&lt;br /&gt;
|-&lt;br /&gt;
| SADisplayMRI || switch MRI display on/off and select small or large window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAElectrodeConfiguration&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || equivalent to pressing the Org or Std button in the Channel box of the Source analysis window&lt;br /&gt;
|-&lt;br /&gt;
| SAExit || close Source Module&lt;br /&gt;
|-&lt;br /&gt;
| SAFit || start fit&lt;br /&gt;
|-&lt;br /&gt;
| SAFitConstraint || set fit constraints, e.g. Residual Variance, Energy, Maximum Distance, Image Weighting, and their weights.&lt;br /&gt;
|-&lt;br /&gt;
| SAFitInterval || set fit or baseline interval&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAHeadModel&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the head model&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SALabelSource&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the label of the specified source number&lt;br /&gt;
|-&lt;br /&gt;
| SAMinimumNorm || run a minimum norm analysis&lt;br /&gt;
|-&lt;br /&gt;
| SANewSolution || open a new solution&lt;br /&gt;
|-&lt;br /&gt;
| SAOpenSolution || open a solution from a file&lt;br /&gt;
|-&lt;br /&gt;
| SAPCA || toggle PCA display of data or residual, and transfer a selected number of components to the source model&lt;br /&gt;
|-&lt;br /&gt;
| SARegularization || set the regularization values both for discrete and distributed source images&lt;br /&gt;
|-&lt;br /&gt;
| SASaveBitmap || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| SASaveLeadfields || save the leadfields of the current source model&lt;br /&gt;
|-&lt;br /&gt;
| SASaveModelWaveforms || save model waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveResidualWaveforms || save residual waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveRVandGFPWaveforms || save residual variance and global field power waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSolution || save the current solution&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceMontage || save a source montage&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceWaveforms || save source waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASendToMATLAB || send data, model, source waveforms, images, etc. to Matlab&lt;br /&gt;
|-&lt;br /&gt;
| SASetCursor || set the cursor&lt;br /&gt;
|-&lt;br /&gt;
| SASetDefaultSourceType || set the default source type (dipole or regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrActivateSource || Turn specified source on or off, or enable/disable source for fitting&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrientation || set orientation (of regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASwitchCondition || switch to a specified condition&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Distributed 3D Volume Images'''&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| SAIMAGEBeamformer || switch between Single Source and Bilateral Beamformer image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAIMAGEBeamformerTimeDomain&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start beamformer computation in the time domain&lt;br /&gt;
|-&lt;br /&gt;
| SAimageBrainAtlas || turns on the Brain Atlas overlay on volumetric image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGECLARA || generate CLARA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip image values under a threshold&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEExport || save the results of minimum norm or 3D imaging method&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEGotoMax || set the crosshair cursor at the nth maximum in the image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEImport || load a 3D volume image from file&lt;br /&gt;
|-&lt;br /&gt;
| SAimageImportFMRI || import fMRI image to Source Analysis Module&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELAURA || create LAURA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELORETA || create LORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESLoreta || create sLORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAimageSESAME || start SESAME computation&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESSLOFO || create SSLOFO image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEUser-Defined || create user-defined image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESaveLeadfields || save the leadfields of all the voxel sources in a 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESmooth || smooth current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESetCrosshair || set the position of the crosshair in the 3D image&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Time-Frequency Analysis''' ('''TFC''')&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot; &lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| TFCStartTFAnalysis ||(previously TFCgo) start TFC analysis using the current paradigm settings&lt;br /&gt;
|-&lt;br /&gt;
| TFCdisplay || change the TFC display (e.g. power/amplitude, coherence)&lt;br /&gt;
|-&lt;br /&gt;
| TFCsave || save numerical results to an ASCII file, or save a screenshot of the TFC window&lt;br /&gt;
|-&lt;br /&gt;
| TFCimage || start beamformer analysis on a selected time-frequency range&lt;br /&gt;
|-&lt;br /&gt;
| TFCSendToMATLAB || send TF results or single-trial data to MATLAB&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How to Average Your Data in a Batch  ===&lt;br /&gt;
&lt;br /&gt;
Using batch processing, several files from an experiment can be averaged at a time.&lt;br /&gt;
&lt;br /&gt;
Here we summarize the steps required:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Create the paradigm, and save the paradigm file.&lt;br /&gt;
* Open each individual data file to check the data:&lt;br /&gt;
** Make sure auxiliary files are defined and loaded properly, and the data are displayed correctly.&lt;br /&gt;
** Eyeball the data.&lt;br /&gt;
** Define bad (and interpolated) channels.&lt;br /&gt;
** Mark artifact time ranges.&lt;br /&gt;
** If required, set up artifact correction for the file.&lt;br /&gt;
** The data file can be closed again after this step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Preparing the batch'''&lt;br /&gt;
&lt;br /&gt;
* Open at least one&amp;amp;nbsp;file and select ''Process / Batch Scripts''.... The file(s) should be displayed in the file list. Alternatively, just select ''Process / Batch Scripts...,'' and add the files by&lt;br /&gt;
** pressing the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** dragging the files from Windows Explorer&lt;br /&gt;
** Opening a previously saved&amp;amp;nbsp;list with ''Load File List''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* You can delete files from the list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt;) or edit the file sequence using the right click context menu.&lt;br /&gt;
* Select the ''Batch Tab''.&lt;br /&gt;
* Add commands to your script. For averaging, these would normally be&lt;br /&gt;
** '''Paradigm''' -- to load the paradigm file&lt;br /&gt;
** '''Artifact Scan''' -- to run the artifact scan&lt;br /&gt;
** '''Average''' -- to perform the average&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Save these commands (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Test the commands on the files in the current file list: press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Look at the log file (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;) to check the results of averaging.&lt;br /&gt;
* Look at the data averages to make sure they have been done correctly.&lt;br /&gt;
* Repeat these steps until averaging is working properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Select ''Process / Batch Scripts''....&lt;br /&gt;
* Open the files you want to average in the batch in the file list:&lt;br /&gt;
** Any files that were open in BESA are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Edit the file list, e.g. delete unwanted files (use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; key or the right click context menu), or reorder the files (use &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl + cursor keys'''&amp;lt;/span&amp;gt; or context menu).&lt;br /&gt;
* Note that the order of files in the list specifies the order in which they will be processed in the batch script. This order will be important if all results are saved to the same target file. Otherwise the file sequence is not important.&lt;br /&gt;
* Optionally, save the file list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Select the ''Batch Tab'', and load the previously defined batch script with ''Load Batch''.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch.&lt;br /&gt;
&lt;br /&gt;
=== How to Merge and Compress raw data  ===&lt;br /&gt;
&lt;br /&gt;
Using the Export command in a batch, several data files can be merged into a single data file in BESA's data format (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.foc&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This can be useful if data from one subject have been collected in several data blocks, and you want to analyze all data blocks together.&lt;br /&gt;
&lt;br /&gt;
Optionally, to save space, data can be saved in compressed format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Files can be merged:'''&lt;br /&gt;
&lt;br /&gt;
* if they have identical channel configurations, or&lt;br /&gt;
* there are at least 16 EEG channels, and the export format is Standard 81 (i.e. EEG channels are interpolated to 81 standard locations). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''How to merge files:'''&lt;br /&gt;
&lt;br /&gt;
* Select '''Process / Batch Scripts...'''&lt;br /&gt;
* Add all the files that are to be merged to the file list:&lt;br /&gt;
** Any files that were open in BESA Research are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list (''Load File List'').&lt;br /&gt;
* Rearrange the files in the file list to the sequence in which they should be merged.&lt;br /&gt;
* Select the ''Batch Tab ''and insert an &amp;quot;''Export&amp;quot;'' command, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following dialog shows a possible configuration of the ''Export'' command:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The parameters shown in the Information box are the settings chosen in the ''Export Dialog'' when the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt; button has been pressed.&lt;br /&gt;
* '''Append if file already exists''' must be checked in order to merge the files.&lt;br /&gt;
* The '''target file name''' must be fixed, i.e. don't use the '''%basename%''' variable, because that will result in a different target file name for each source file.&lt;br /&gt;
* There are two variables that can be used for the segment label:&lt;br /&gt;
** '''%filename%''' will insert the basename of the source file into the segment label.&lt;br /&gt;
** '''%c%''' will insert the file number into the segment label. The number gives&amp;amp;nbsp;the position of the file in the file list. For instance, &amp;quot;File %c%&amp;quot; will generate the label &amp;quot;File 2&amp;quot; for the second file in the list.&lt;br /&gt;
&lt;br /&gt;
=== Example: Data averaging in the auditory intensity experiment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, two raw data files, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;, from the auditory intensity experiment will be batch averaged.&lt;br /&gt;
&lt;br /&gt;
Please note that there are further tutorials covering this experiment. The first file is contaminated by many eyeblinks, and more epochs would be averaged if eye correction were used (see Viewlet demonstration on artifact correction on the BESA website). However, in this tutorial we will just use artifact rejection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Various ways of creating a File List'''&lt;br /&gt;
&lt;br /&gt;
1. '''Files that were open in BESA Research are automatically added to the File List.''' Start BESA Research and open the files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt '''&amp;lt;/span&amp;gt;in the directory ''Examples\ERP-Auditory-Intensity''.&lt;br /&gt;
&lt;br /&gt;
2. Select ''Process / Batch Scripts''.... You should see the file names in the '''''File List Tab''''' something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. You can resort the files in the file list alphabetically by clicking onto the '''''File List column header''''':&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can mark any file, hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;key and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrow '''&amp;lt;/span&amp;gt;to move the file name up or down the list. This is the sequence in which files will be processed in the batch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; and save the list you have created to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Highlight both names and press the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
6. '''Files can be dragged from Windows Explorer'''. Start Windows Explorer and navigate to the ''ERP-Auditory-Intensity'' subdirectory of your BESA Research examples folder (located in the ''Public Documents'' folder of your computer). Click on &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and drag it with the mouse onto the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''''File List Tab'''''. Let go of the mouse. BESA Research opens the file, and displays the name in the File List. Repeat for &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt.'''&lt;br /&gt;
&lt;br /&gt;
7. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
8. '''Files can be added using the ''Add File'' button'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; and navigate to the ''Examples\ERP-Auditory-Intensity'' subdirectory. Select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt;. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl'''&amp;lt;/span&amp;gt; and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;. Both names should then be displayed in the ''File Open'' dialog. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to add the files to the file list.&lt;br /&gt;
&lt;br /&gt;
9. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
10. '''Files can be loaded from a previously saved file list'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List '''&amp;lt;/span&amp;gt;and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;, the list you saved in step 6 above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Setting up the batch'''&lt;br /&gt;
&lt;br /&gt;
1. We will add three commands, '''Paradigm''', '''Artifact Scan''', and '''Average''', to create a batch that will be applied to the two files in the file list.&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''Batch Tab'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button to obtain the ''Select Command'' window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (9).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt; and then on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; (alternatively, double-click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt;). Hit &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Browse'''&amp;lt;/span&amp;gt;, navigate to the ''Auditory'' folder, and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''AEP_Intensity.pdg'''&amp;lt;/span&amp;gt;, the paradigm for the auditory intensity experiment.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (10).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to obtain the ''Load Paradigm Task'' window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (11).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;, and the first task in the batch is ready, and listed in the Batch Command window. If you want to modify the command, double-click on it to open the above window, that allows to browse for a different paradigm file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (12).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Next, we add the '''Artifact Scan''' command. Click on the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select ''Artifact Scan.''&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (13).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Artifact Scan Task'' window. We want to be able to view the results of the scan, and adjust thresholds and bad channels if necessary. Therefore, check the ''Wait after scan'' checkbox.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (14).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to close the ''Artifact Scan Task'' window. Our batch now contains two commands.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (15).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Finally, we will add an '''Average''' command. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button and select ''Average''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Average Task ''window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (16).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. With the default settings, the average would be saved to the same directory as the data. The file name mask is set by default so that in this example the two averages would be saved to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1-av.fsg '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2-av.fsg'''&amp;lt;/span&amp;gt;. We will save the averaged files to subdirectory ''&amp;quot;Averages''&amp;quot; of the data directory. Uncheck the ''Use default target'' check box, change the File name mask to '''%basename%_av-test''' in order not to overwrite the predefined files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (17).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Average Task'' window. Our batch is now complete.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (18).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
13. We will now save the batch so that it can be used again. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt; button, and save to the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-ex1.bbat'''&amp;lt;/span&amp;gt;. Note that an easy way to generate new averaging batches is to load a previously save batch and edit the commands -- it may only be necessary to edit the '''Paradigm''' command to select the relevant paradigm file, and maybe to adjust the target directory in the '''Average''' command.&lt;br /&gt;
&lt;br /&gt;
14. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch'' Window to start the batch running. As requested, the batch pauses after the artifact scan:. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (19).gif]]&lt;br /&gt;
&lt;br /&gt;
You may now adjust the number of rejected trials, e.g. by moving the vertical red bar to the left, or exclude bad channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to continue with averaging.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (20).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
16. Note that, in the background, the ''Batch Running'' window is providing feedback about the current file and current task.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
17. The batch will stop again after the next artifact scan. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to allow the batch to run to the end.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (21).gif|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
18. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log'''&amp;lt;/span&amp;gt; to view the batch protocol. If you are using Internet Explorer or Netscape family (Mozilla, Firefox) browsers, and JavaScript is enabled, you will first see just batch titles defined by the date and time the batch was started. The most recent title is at the top of the list. For other browsers, or if JavaScript was not enabled, all protocol texts are expanded as in 19 (below).&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (22).gif|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
19. Click on the first title to expand its protocol. Here, for example, the protocol gives feedback about the number of epochs that were averaged for each file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (23).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
20. Finally, press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to return to the main BESA Research display. Open the averages in the ''Averages'' subdirectory to confirm that they were generated properly.&lt;br /&gt;
&lt;br /&gt;
=== Example: Merging files using the Export Command ===&lt;br /&gt;
&lt;br /&gt;
Here we will demonstrate the use of the '''Export '''command to merge two files. We will combine the two averages from the previous example (Data averaging in the auditory intensity experiment) into one target file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Generate the file list'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and load the two data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av-test.fsg'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2_av-test.fsg'''&amp;lt;/span&amp;gt; that were saved in the previous example.&lt;br /&gt;
# Select ''Process / Batch Scripts....''The two file names should be displayed in the file list.&lt;br /&gt;
# In the file list, make sure that &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1_av-test.fsg '''&amp;lt;/span&amp;gt;is the first file in the list. If it is not, highlight the file, and move it up using &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl+up'''&amp;lt;/span&amp;gt;, or right click and select ''Move Up'' in the context menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Generate the batch'''&lt;br /&gt;
&lt;br /&gt;
1. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select the '''Export''' command.&lt;br /&gt;
&lt;br /&gt;
2. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Export Task'' window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (24).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt;... button to open the ''Export Dialog''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (25).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Since we are combining averages, select ''Hires (no compression)'' in the '''Target data format''' drop-down list (If we were merging raw data files, it is better to select compression. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the dialog. Check'' Append if file already exists'', so that the files will be merged. Enter '''s1+s2''' in the target file name mask edit box. This ensures that both files will be saved to the same target: &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (26).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Export Task'' window. The '''Export '''command is displayed. &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (27).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Optionally, you may save the batch file by pressing &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
7. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch, and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch Completed'' window to return to the BESA main window.&lt;br /&gt;
&lt;br /&gt;
8. Finally, open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt; to confirm that it contains the two merged files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Merge raw data'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Repeat the above task to merge the two raw data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2.cnt'''&amp;lt;/span&amp;gt; into a single target file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.foc'''&amp;lt;/span&amp;gt;. In this case, select one of the compression options as the target data format. Note that you would not normally want to merge two files from different subjects. However, several data blocks from the same subject can conveniently be merged using this method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; files can also be merged using the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''Combine Conditions''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; dialog. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions, Channels ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Combine Condition Scripts ===&lt;br /&gt;
&lt;br /&gt;
With the Combine-Conditions module you can do a variety of operations on BESA averages (files with the extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, and other segment files, such as &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.mul&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.swf&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* Create grand averages&lt;br /&gt;
* Combine averages (add, subtract, weighted/unweighted)&lt;br /&gt;
* Merge files&lt;br /&gt;
* Exclude unwanted averages&lt;br /&gt;
* Rename conditions&lt;br /&gt;
* Rename or resort channels&lt;br /&gt;
* Generate averages or differences over selected channels&lt;br /&gt;
* Transform the data: standard interpolated 81 electrodes, change sampling rate, change interval&lt;br /&gt;
* Determine peaks, mean amplitudes, or integrals on data averages&lt;br /&gt;
* These operations can be performed on one or more files simultaneously. Results of an operation are stored in a single target file.&lt;br /&gt;
&lt;br /&gt;
The module includes four tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* File List: Define a list of files on which the operations will be performed.&lt;br /&gt;
* Condition List: List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
* Channel List: List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
* Run Scripts: Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak analysis). Start the operation.&lt;br /&gt;
* Note that in all four tabs, configurations can be saved for future use, and the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button restores the most recently used configuration.&lt;br /&gt;
&lt;br /&gt;
=== Condition List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
&lt;br /&gt;
The first column of the&amp;amp;nbsp;list box shows a list of all the condition names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the source conditions. Columns define the target conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each condition name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target conditions will have the same name as source conditions. Right click on source condition labels to view properties (e.g. no. of samples, time range, sampling rate).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (28).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the condition list'''&lt;br /&gt;
&lt;br /&gt;
* Target condition names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: conditions can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over conditions, the sum is divided by the number of conditions, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;''Divide the result by the sum of PLUS factors''&amp;quot; is unchecked, the conditions will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between conditions, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the condition list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Weighting of averages'''&lt;br /&gt;
&lt;br /&gt;
* Below the list, click on the ''Weighted Average'' row to toggle &amp;quot;YES&amp;quot; and &amp;quot;NO&amp;quot;. &amp;quot;YES&amp;quot; means that averages will be weighted by the number of epochs contributing to the average. For instance, if average A contained 100 epochs and average B contained 200 epochs, the weighted average will be computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(100 * A + &amp;amp;nbsp;200 * B) / (100 + 200)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Select &amp;quot;NO&amp;quot; for an unweighted average. For the above example, the average is computed as&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(A + B) / 2&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Weighted averages are not permitted if one of the boxes contains a negative value.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Values other than +1 or -1 in the boxes apply a different kind of weighting. For instance, we want to compute the difference between the means of conditions A, B, C and D, E. Use a right-click to specify the fraction 1/3 for each of A, B, and C, and -1/2 for each of D and E (see example below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (29).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Feedback'''&lt;br /&gt;
&lt;br /&gt;
* Conditions that have different numbers of electrodes (averaging across different files) can only be combined if channels are interpolated to a standard set of electrodes.&lt;br /&gt;
* Conditions that have different durations or sampling rates can only be combined if the sampling rate and durations are made the same.&lt;br /&gt;
* Feedback about the above situations is displayed by the presence of tick marks above the list box.&lt;br /&gt;
&lt;br /&gt;
=== Channel List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
&lt;br /&gt;
Note that this tab is very similar in usage to the '''Condition List Tab'''. Note also that some of the functions performed in this tab could also be done in the Montage Editor. It may be a matter of convenience whether you choose to perform these operations here or in the Montage Editor.&lt;br /&gt;
&lt;br /&gt;
The first column of the list box shows a list of all the channel names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the ''source'' channel. Columns define the'' target'' channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each channel name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target channel will have the same name as source channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Combining files'''&lt;br /&gt;
&lt;br /&gt;
If files with different channel configurations are included in the File List, the rows and columns of the Channel List Tab will only contain the labels for the channels that are in common among the files.&lt;br /&gt;
&lt;br /&gt;
If the files in the File List have a different sequence of channels, the sequence of the first file in the list will be adopted in the Channel List.&lt;br /&gt;
&lt;br /&gt;
Thus, for the initial setting, unless the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked, the target grand average or peak/amplitude analysis, etc. will be applied using only channels that are in common among the input files, and using the channel sequence of the first file in the File List. By changing the target channels or by changing the entries in the Channel List, new channels consisting of averages or differences can be generated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''What can the Channel List be used for?'''&lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
&lt;br /&gt;
* Reorder or relabel channels&lt;br /&gt;
* Create channel differences&lt;br /&gt;
* Create averages over channel groups, e.g. for peak analysis&lt;br /&gt;
* Extract a selection of channels for peak analysis or mean amplitudes&lt;br /&gt;
* Create grand averages across files with different channel configurations, just using channels in common among the files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (30).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the channel list'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Target channel names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: channels can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over channels, the sum is divided by the number of channels, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;Divide result by the sum of PLUS factors&amp;quot; is unchecked, the channels will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between channels, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the channel list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Channel List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Channel List&amp;amp;nbsp;'''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
=== Run Scripts Tab ===&lt;br /&gt;
&lt;br /&gt;
Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak detection. Start the operation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load or Save Settings'''&lt;br /&gt;
&lt;br /&gt;
* You can save the current settings of this tab to a file (*.run) which can be loaded later.&lt;br /&gt;
* When you run the script, the current settings are saved automatically to a file &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* Press this button to load the previous settings (from &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Averages to Generate'''&lt;br /&gt;
&lt;br /&gt;
* '''Generate separate averages for each source file'''. Averages are performed over conditions within the source file, and are then appended to the target file.&lt;br /&gt;
* '''Combine data from source files'''. Conditions are combined over all source files into a single target average.&lt;br /&gt;
* '''No averages, just copy'''. Files are copied and merged to the target file. Use this option for renaming conditions, merging files, removing unwanted averages (see below), changing the sampling rate and interval.&lt;br /&gt;
* '''Peaks and mean amplitudes'''. Specify time ranges for peaks, mean amplitudes, or integrals (areas).&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note: When generating or copying averages (first three options), filters and baseline settings are turned off. For Peaks and mean amplitudes, filters and baseline settings are specified in the dialog.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Spatial Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Interpolate to Standard 81 electrodes'''. The target file will contain only electrodes (other channels are omitted), using the Standard 81 configuration (as in other export functions within BESA Research). This cannot be selected if the source data contain less than 16 EEG channels.&lt;br /&gt;
* '''Interpolate Bad Channels'''. Bad electrode channels in the source file will be interpolated. If the above option is deselected and bad channels exist in one or more of the source files, this option is always on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;BESA Research can interpolate EEG, and MEG if the sensors are axial gradiometers or magnetometers. If other channels are marked as bad in one or more of the source files, these will be defined as bad in the target file. This applies to MEG planar gradiometers, to polygraphic data, and to ICR channels.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Temporal Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Spline to New Sampling Rate and Interval'''. Data can be converted to a new sampling rate, and the interval can be changed.&lt;br /&gt;
** If the sampling rate is reduced, the data will be low-pass filtered at 1/3 sampling frequency before reduction.&lt;br /&gt;
** If the sampling interval is changed, the prestimulus and poststimulus intervals are limited by the smallest intervals in the conditions contributing to the averages. These limits are shown below the edit boxes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks and Mean Amplitudes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (31).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range between which peaks are to be determined.&lt;br /&gt;
* Select the montage on which the peaks are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Define the baseline settings.&lt;br /&gt;
* Specify whether peaks are to be defined at one latency: if so, select the channel on which peaks are to be detected.&lt;br /&gt;
* Specify whether you want to find positive or negative peaks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Mean amplitudes and areas:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range over which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Select the montage on which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Note that when computing areas, data are first rectified (made positive) and then summed over the time range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Output options of the analysis:'''&lt;br /&gt;
&lt;br /&gt;
* A single ASCII file that contains the result of the analysis for all data sets, conditions, and channels including header and information lines.&lt;br /&gt;
* A sparse output suitable for import in SPSS. Each variable (e.g. a latency, a channel amplitude) constitutes one column of the output file.&lt;br /&gt;
* Direct transfer to MATLAB into a struct besa_peak. For more information on the data transfer from BESA Research to MATLAB, please refer to help chapter ''“The MATLAB interface”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Starting the Operation'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;to start the operation. After the operation is completed, and the &amp;quot;Open target file in BESA&amp;quot; box is checked, BESA Research will open the target file. &amp;amp;nbsp;&amp;quot;Open target file in BESA&amp;quot; cannot be checked if &amp;quot;Peaks and mean amplitudes&amp;quot; was selected - then the result of the operation will be an ASCII file or a MATLAB transfer.&lt;br /&gt;
* You will be asked for the name of the target file (unless a MATLAB transfer of peak data has been performed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Restrictions'''&lt;br /&gt;
&lt;br /&gt;
* Depending on source file configurations, not all options above are selectable. For instance, if two files contain different numbers of electrodes, and the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked in the '''''Channel List''''' Tab, spatial interpolation to Standard 81 is enforced in the target. Similarly, if different sampling rates are used in different files, temporal interpolation is enforced.&lt;br /&gt;
* You are not allowed to add files to the file list if the channel configuration is different, and the data cannot be combined with Standard 81 interpolation. Since Standard 81 interpolation is only possible for EEG, multiple files without EEG can only be loaded if they have the same number of channels.&lt;br /&gt;
&lt;br /&gt;
=== How to Create Grand Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to average in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To average across different conditions, click in the list boxes to obtain &amp;quot;+1&amp;quot; for each source condition to combine, and rename the target condition to define a meaningful name for the average.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Generate Differences Between Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To create differences, click in the list boxes to obtain &amp;quot;+1&amp;quot; for one of the source conditions, and &amp;quot;-1&amp;quot; for the source condition to subtract, and rename the target condition to define a meaningful name for the difference.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. An average of the differences is generated. If only one example of each condition exists, e.g. in a grand average file, the result is the difference between conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Merge Files ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to merge in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notes'''&lt;br /&gt;
&lt;br /&gt;
* If the source files have different electrode configurations, use the Standard 81 configuration for the target.&lt;br /&gt;
* If the source files have different sampling rates or intervals, use Temporal Interpolation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Remove Unwanted Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted segments'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as averages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted conditions (by label)'''&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Deselect the target conditions you want to omit (replace the &amp;quot;+1&amp;quot; by a blank).&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as artifacts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Rename Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. Click on column headings to rename the target conditions.&lt;br /&gt;
* Click on the''' Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data with the renamed conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Change the Sampling Rate ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file(s) you want to change in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...'').&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Select &amp;quot;''Spline to New Sampling Rate and Interval''&amp;quot; and type the new sampling rate into the edit box.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Create grand average and combinations of conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, we will generate a grand average of the results of the Auditory Intensity Experiment. The experiment includes averages from five different stimulus intensities. We will create a grand average over each intensity, but also include means over the two lowest and the two highest intensities, and the difference between these two combinations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av.fsg - S10_av.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The files contain the individual averaged data of the 10 subjects who participated in this study.&lt;br /&gt;
# Select ''ERP / Combine Conditions...'' The file list should display the two files, with feedback about the number of averages and conditions. 8 epochs are found. See the ''“Data averaging in the auditory intensity'' ''experiment”'' example for examples how to manipulate the file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (32).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. The initial window defines target conditions with the same name as the source conditions. To generate the grand average over these conditions we could proceed without further changes to the '''Run Scripts Tab'''. However, we want to modify the condition list and create a condition that contains the grand averaged difference between the''' High''' and '''Low''' conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''All '''column label. In the resulting window, rename condition '''All''' to''' Difference'''. Then press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (33).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. The last column is now labeled '''Difference.''' Left-click twice onto the ‘'''+1’''' entry that links this condition to the '''All '''input condition. This will remove the link and leave the field blank. To define the ‘Difference’ condition as the average of ‘High’ minus ‘Low’ over subjects, left-click once into the field linking input '''High''' with target '''Difference''' to generate an entry ‘'''+1’''' in this field. Left-click twice into the field linking input '''Low '''with target '''Difference''' to generate an entry '-'''1'''’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;[[Image:Batch processing (35).gif]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; and save the list to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ER&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;P-aud-ex1.clist'''&amp;lt;/span&amp;gt;. This condition combination can thus be loaded later using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Click on the '''Run Script Tab'''.&lt;br /&gt;
# The default tab settings are ready for generating the grand average ('''Combine data from source file''' and '''Open target file in BESA''' should be checked). Just press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Enter &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_cc-test.fsg'''&amp;lt;/span&amp;gt; as file name and press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Save'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The resulting file contains the 8 target conditions, 60db, 70dB, 80dB, 90dB, 100dB, Low, High, and Difference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Average files from different experiments ===&lt;br /&gt;
&lt;br /&gt;
This example is intended to illustrate several features of the ''Combine Conditions'' Dialog, such as electrode interpolation and resampling. We will combine an average from the Auditory Intensity experiment with one from the P300 auditory experiment. In this particular case, it is not a very meaningful thing to do, but it shows what is possible. For instance, the same experiment may have been performed using different sampling rates or electrode combinations. This example shows how such data may be combined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_GA.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The file contains the grand average data from the auditory intensity experiment.&lt;br /&gt;
# Open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''RareFrequentResponseLeft.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-P300-Auditory'' folder. This file contains averages from the P300 auditory experiment.&lt;br /&gt;
# Select ''ERP / Combine Conditions... ''Note that the files have different sampling rates and different numbers of electrodes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (36).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. Note that the feedback text at the bottom of the window displays the text &amp;quot;Standard 81 interpolation required to generate average; Across files: resampling or change in time range required to generate average&amp;quot;. The condition labels show all the names from both files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (37).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.  We will exclude most conditions, and just combine the most similar conditions from the two experiments: the &amp;quot;Standard&amp;quot; and the &amp;quot;80dB&amp;quot; conditions. Click on the title of the first column,''' Blink'''. Select “''Delete all conditions to the right of this column”'', and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (38).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on the title again, and rename the target condition to &amp;quot;Standard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (39).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click twice in the first line to remove the &amp;quot;+1&amp;quot; entry there. Click once in the third row (&amp;quot;Frequent&amp;quot;), and in the 7th row (&amp;quot;80dB&amp;quot;), to display &amp;quot;+1&amp;quot; at each entry. Thus, just two of the conditions will be combined into one target condition.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (40).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Run Script Tab'''. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (41).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Note that '''Interpolate to Standard 81 electrodes''' is checked and grayed: since two different electrode sets are to be combined, we can only do this by interpolating electrodes. Also, both '''Spline to new sampling rate''' and '''Clip interval '''are checked and grayed. Again, these settings are required in order to be able to average the two data files together. The sampling rate is set to the higher of the two selections. The time range is set to the largest possible range that can be clipped from the two data sets. For now, leave these settings as they are, and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Save the target to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''TestCombineExpts_CC-std81.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing</id>
		<title>BESA Research Batch Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing"/>
				<updated>2021-05-05T13:15:00Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==  Batch Processing and Combining Conditions == --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions and Batch Module: Introduction ==&lt;br /&gt;
&lt;br /&gt;
Functions of this module are started by selecting the menu operations &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Combine Conditions...'''&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Batch Scripts...'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''Combine Condition Scripts''' provides various operations on BESA averages.&lt;br /&gt;
* '''Batch Scripts''' provides batch operations on all data files.&lt;br /&gt;
* Note that a batch script can also be performed on the current file by selecting &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Run Batch...'''&amp;lt;/span&amp;gt;&amp;quot; or by typing the shortcut key &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''R'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== File List Tab ==&lt;br /&gt;
&lt;br /&gt;
Define a list of files on which the operations will be performed. The tab is the same for Combine Conditions Scripts and for Batch Scripts. Combine Conditions Scripts only allows you to open BESA average files (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, but also &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.raw'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.swf'''&amp;lt;/span&amp;gt;, and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt; if the files have a defined pre-stimulus interval), whereas Batch Scripts allows you to open any data file whose format is known to BESA Research.&lt;br /&gt;
&lt;br /&gt;
When the Combine-Conditions or the Batch module is started, all currently opened (Combine-Conditions: averages only) files are displayed in the list.&lt;br /&gt;
&lt;br /&gt;
To the right of each file name, the number of electrodes, total number of channels, and the sampling rate used in the file are displayed. In the Combine-Conditions module, the number of Epochs (segments) and the number of differently-named conditions are also shown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add files to the list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File '''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
* Drag one or more files from Windows Explorer onto the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Remove files from the list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and confirm the delete operation in the resulting dialog.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key to mark multiple files). Right click to obtain the context menu and select &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;quot;, or just press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Reorder files within the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctr'''&amp;lt;/span&amp;gt;l key to mark multiple files). Right click to obtain the context menu and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;, or hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key '''and '''press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrows'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sort the current file list alphabetically'''&lt;br /&gt;
&lt;br /&gt;
* Click on the File bar above the list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List'''&amp;lt;/span&amp;gt; button, or the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button to load the most recently used file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Which conditions are read from a source file? (Combine-Conditions module only)'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File list from Combine Conditions:'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (1).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Don't try to open here... (Batch only)'''&lt;br /&gt;
&lt;br /&gt;
By default, this checkbox is unchecked.&lt;br /&gt;
&lt;br /&gt;
In the checked state, BESA Research doesn't check if it can open the file. Use this function '''only''' if the file is ASCII and you want to use the '''ImportASCII '''batch command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File List from Batch Scripts''':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (2).png]]&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Batch Processing &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== Batch Processing Scripts ===&lt;br /&gt;
&lt;br /&gt;
With Batch Scripts, you can define a set of operations (e.g. Artifact Scan, Average, etc.) and apply these to several data files.&lt;br /&gt;
&lt;br /&gt;
These operations include&lt;br /&gt;
&lt;br /&gt;
* Load Paradigm&lt;br /&gt;
* Artifact Scan&lt;br /&gt;
* Average&lt;br /&gt;
* Export (and Merge)&lt;br /&gt;
* File Open (switch to another data file)&lt;br /&gt;
* Set filters&lt;br /&gt;
* Specify a montage (used, for example, for export to current montage)&lt;br /&gt;
* Run automatic eye and EKG artifact correction&lt;br /&gt;
* Define artifact topographies&lt;br /&gt;
* Turn artifact correction and view on and off&lt;br /&gt;
* Read and write events&lt;br /&gt;
* Edit default block epoch (for export around triggers)&lt;br /&gt;
* Edit triggers (for export around triggers)&lt;br /&gt;
* Mark a block for export, or send the block to Source Analysis or Top View&lt;br /&gt;
* Convert patterns to triggers&lt;br /&gt;
* Attach auxiliary files (e.g. elp, sfp) to the data file&lt;br /&gt;
* Send to MATLAB&lt;br /&gt;
* Specify display configurations for the BESA Research Main, SA, and Top View windows&lt;br /&gt;
* and more - see the full list of [[#Batch Commands|Batch Commands]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An additional set of commands are available for operations in the '''Source Analysis Module''', allowing to load, create and fit dipole models, and save the results.&lt;br /&gt;
&lt;br /&gt;
A further set of commands apply to '''Time-Frequency Analysis''', allowing to start TFC, change the display, save results, and run the beamformer or DICS analyses on a selected time-frequency range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
These operations will be extended in future program releases.&lt;br /&gt;
&lt;br /&gt;
The module includes two tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* '''File List''': Define a list of files on which the operations will be performed.&lt;br /&gt;
* '''Batch''': Define or load '''batch commands'''. Run the batch.&lt;br /&gt;
&lt;br /&gt;
=== Batch Tab ===&lt;br /&gt;
&lt;br /&gt;
Load or define batch commands, and then apply them to the files in the File List.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add Command'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; to add a new command to the batch. The following dialog is opened, showing the available commands:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Select the desired command and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; or double-click on the command. A dialog box is opened, allowing to specify individual command parameters.&lt;br /&gt;
* If you click on &amp;quot;Apply at beginning of batch&amp;quot; or &amp;quot;Apply at end of batch&amp;quot;, the command will only be run at the beginning or the end of a batch. You can use this, for example, at the end of a batch to start a MATLAB script to perform statistics on the results of the batch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load and Save Batch'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load a previously defined batch or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to save the current batch to a file (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.bbat&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load the most recently used batch file. Whenever a batch is run, the current set of commands is written to the file &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Previous.bbat in'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Scripts/Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; subdirectory. This file is loaded when you press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Clear All'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Clears all commands from the window.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''View Log File'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Each time a batch is run, BESA Research adds information about the batch to a log file, with headings showing the date and time the batch was started. The file is opened automatically in Internet Explorer if errors occurred during processing. Otherwise you may open the file by &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button here or in the dialog that is displayed at the end of batch processing. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The log file is saved in xml format, and a JavaScript is used to format the display in web browsers. JavaScript should be enabled in the browser to obtain an optimal display of the results. If JavaScript is enabled, the log file is displayed as a list of headings for each batch. Click on a heading to display the results of the corresponding batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;To open the log file in the Notepad, hold the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Shift '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;key down when pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Batch Command List'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Double-click on a command to edit it. See &amp;lt;/span&amp;gt;[[#Batch Commands|Batch Commands]]&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for descriptions of the dialogs that are opened to edit each command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Right click on a command to open a context menu allowing more options.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Move Up'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''and Move Down'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; can also be applied to multiple selections.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If you have made a multiple selection, the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button will delete all the marked commands. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;plus &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''cursor keys'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will move the marked commands up or down.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Comment'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove a semicolon (;) in front of the command, to deactivate or reactivate the command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Command Only at Start/End'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove the text &amp;quot;Start_&amp;quot; or &amp;quot;End_&amp;quot; in front of the command. With these prefixes, the command will only be performed when the first file (&amp;quot;Start_&amp;quot;) or the last file (&amp;quot;End_&amp;quot;) in the file list is being processed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Single Step Mode'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Check this item to step through the batch, one command at a time. A dialog is opened after each command, allowing to run the next command, continue the batch without single steps, or stop running the batch. See the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'' “Pause''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;” command for further details.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;During a batch, press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changes in batch written to database'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Checked by default. If this item is unchecked, file display settings, such as Montage setting and Artifact correction display, are not written to the database. When the file is next opened in BESA Research, the settings made in the batch are not retained.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Leave files in the file list open after running the batch'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If this item is checked, files in the file list will remain open after the batch. This is useful, for instance, if you want to open a set of files, specifying the same montage and/or filter settings for each file.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to start running the batch. Each command is then applied in succession to each file in the File List.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that, while a batch is running press and hold down the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The log file ===&lt;br /&gt;
&lt;br /&gt;
A protocol of each batch is written to the log file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Scripts/Log/Batch.xml.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File '''&amp;lt;/span&amp;gt;button, the file is opened in your default browser for xml files. The file will be opened automatically if there was an error during batch processing unless you have used the ''BatchError'' batch command to suppress this behaviour.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''DHTML formatting of the log file'''&lt;br /&gt;
&lt;br /&gt;
The xml file is formatted using JavaScript (Dynamic HTML). If JavaScript is enabled in your browser, you will first see a list of batch protocol titles, labelled by the date and time at which the batch was started. The most recent batch is at the top of the list.:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).png|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the title to view the protocol for the corresponding batch:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''JavaScript and XP Service Pack 2'''&lt;br /&gt;
&lt;br /&gt;
By default, if the log file is opened in Internet Explorer after XP Service Pack 2 has been installed, IE will warn you with the message: &amp;quot;''To help protect your security, Internet Explorer has restricted this file from'' ''showing active content that could access your computer&amp;quot;.'' All the protocols in the log file are displayed. You may safely click on the options to allow active content in the log file, if you want to display the file as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Backup of the log file'''&lt;br /&gt;
&lt;br /&gt;
When the log file is written, a backup of the previous version is written to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml.bak'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the size of the log file exceeds 200 KB, it is renamed to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml_date_time'''&amp;lt;/span&amp;gt; (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.xml_2004-10-08_10-53-32'''&amp;lt;/span&amp;gt;), and a new version of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml'''&amp;lt;/span&amp;gt; is created.&lt;br /&gt;
&lt;br /&gt;
=== Placeholders ===&lt;br /&gt;
&lt;br /&gt;
A powerful feature of the batch commands is the ability to define file names and specify standard paths using placeholders. These are text strings enclosed by percentage (%) signs. They can be used in all batch commands where file names are specified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Basename'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Placeholder !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; width=&amp;quot;10%&amp;quot;|'''%basename%'''&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|replaced by the basename of the currently opened file.&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%basename-n%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the last &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%-nbasename%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the first &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasename%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list (it has the same meaning as %basename% if no MAINFileOpen batch command was used in command list)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%base%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file without the path&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbase%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list without the path&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%ext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%basefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%t%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: time since start of batch on current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%T%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: current date and time&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%label%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Replace label of the most recent marked block by the block label, not including no. of averages&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%LABEL%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
| Replace label of the most recent marked block by the block label, including no. of averages&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%scripts%'''&lt;br /&gt;
|replaced by the path to the Scripts folder.&lt;br /&gt;
|&amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard MATLAB scripts used by BESA Research.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%montages%'''&lt;br /&gt;
|replaced by the path to the Montages folder.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%examples%'''&lt;br /&gt;
|replaced by the path to the Examples folder.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''%basename%''' -- replaced by the basename of the data file in the File List. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''%basename-n%''' -- replaced by the basename of the data file in the File List, but removing the last &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%-nbasename%''' -- replaced by the basename of the data file in the File List, but removing the first &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%scripts%''' -- replaced by the path to the Scripts folder (e,g, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard Matlab scripts used by BESA Research).&lt;br /&gt;
&lt;br /&gt;
* '''%montages%''' -- replaced by the path to the Montages folder.&lt;br /&gt;
&lt;br /&gt;
* '''%examples%''' -- replaced by the path to the Examples folder.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Placeholders for folders'''&lt;br /&gt;
&lt;br /&gt;
The following placeholders are the same as those used in the [Folders] section of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Besa.ini'''&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The strings enclosed by percent signs (%) are placeholders for the following folders in English-language versions of Windows. Folder names are different for the system and for other language settings. BESA Research will substitute the placeholders by the appropriate folder name for the Windows system and the system language:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 10 (English)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%localapp%''' = &amp;quot;&amp;quot;C:\Users[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;&amp;quot;Desktop[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%publicprog%''' = &amp;quot;Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;&amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Desktop\[User]\Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir%'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 7 (English):'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%localapp%''' = &amp;quot;C:\Users\[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;Desktop\[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%publicprog%''' = &amp;quot;C:\Users\Public\Public Documents\BESA\Research_7_1&amp;quot;. This folder is directly accessible from the Windows Explorer under &amp;quot;Libraries\Documents\Public Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;&amp;quot;Libraries\Documents\My Documents\Research_7_1&amp;quot; or &amp;quot;Desktop\[User]\My Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir% &amp;amp;nbsp;'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Batch Commands ===&lt;br /&gt;
&lt;br /&gt;
Batch commands are selected when the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt;&amp;quot; button is pressed in the &amp;quot;Batch&amp;quot; Tab. The commands are subdivided into five categories: General commands, commands for the Main module, for the Source Analysis module, imaging commands in the Source Analysis module, and commands for Time-Frequency Analysis. The commands have prefixes,''' GEN''', '''MAIN''',''' SA''', '''SAIMAGE''', and''' TFC'''), which identify the category. For compatibility with older program versions, old batches without the prefixes are accepted.&lt;br /&gt;
&lt;br /&gt;
Detailed descriptions of each batch command are available in the electronic help chapter “''Batch Processing and Combining Conditions / Batch Processing / Batch Commands”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands''' - prefixed with &amp;quot;'''GEN'''&amp;quot; (can be used anywhere):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot; style &lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| GENBatchError || used to change program behavior when errors occur&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENBatchWindowPosition&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the position of the batch window relative to the main window&lt;br /&gt;
|-&lt;br /&gt;
| GENComment || comment in the batch script: no batch functionality&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABcommand || send a command string to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABwaitForVariable || tells BESA to wait until Matlab has created a variable with the specified name.&lt;br /&gt;
|-&lt;br /&gt;
| GENPause || pause batch operations, allowing step-by-step operations&lt;br /&gt;
|-&lt;br /&gt;
| GENFor/GENEndFor|| a programming language-like FOR loop&lt;br /&gt;
|-&lt;br /&gt;
| GENRunProcess || runs a command-line process, e.g. an external program to perform part of the data analysis in the batch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENsaveBitmap&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SetVariable&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the value of the variable is inserted into subsequent batch commands where the text contains the name flanked by % signs&lt;br /&gt;
|-&lt;br /&gt;
| GENWindowPosition || set window size and positions to a selection of standard settings, e.g. for bitmap export&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for the Main Module''' - prefixed with &amp;quot;'''MAIN'''&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| MAINArtifactCorrect || run automatic artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactMethod || specify the method for artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactOn || turn artifact correction an artifact view on or off&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifact Scan || run an artifact scan as from the Paradigm Dialog&lt;br /&gt;
|-&lt;br /&gt;
| MAINAuxiliaryFiles || associate auxiliary files (e.g. *.''ela'', *.''sfp'') with the data file&lt;br /&gt;
|-&lt;br /&gt;
| MAINAverage || average the data&lt;br /&gt;
|-&lt;br /&gt;
| MAINBaseline || specify the parameters for baseline correction&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINDefineArtifactTopography&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || define an artifact topography&lt;br /&gt;
|-&lt;br /&gt;
| MAINEditDefaultEpoch || edit the default block epoch&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventRead || read events from an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventWrite || write events to an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINExport || export or append data in the selected target format&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINExportToBESAConnectivity&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || export data segments to BESA Connectivity&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFT || calculates the FFT spectrum of the marked data interval&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTmean || starts an averaging procedure that calculates the mean spectral properties in pre-defined regions&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTsave || saves FFT data (generated using the ''FFT Average option'' in the ''Average ''command) to disk (*.''fma)''&lt;br /&gt;
|-&lt;br /&gt;
| MAINFileOpen || close the current file and open a new file to which the remaining batch commands will be applied&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINFileClose&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || close the currently open file in a batch, provided it is not the current file in the File List&lt;br /&gt;
|-&lt;br /&gt;
| MAINFilter || set filters&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINfMRIArtifact&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns on the fMRI artifact removal&lt;br /&gt;
|-&lt;br /&gt;
| MAINGoTo || jumps with the cursor to the specified time point&lt;br /&gt;
|-&lt;br /&gt;
| MAINICA || starts ICA decomposition of data on the current screen &lt;br /&gt;
|-&lt;br /&gt;
| MAINICAsave || saves selected ICA components as topographies in a file&lt;br /&gt;
|-&lt;br /&gt;
| MAINICAselect || opens component selection dialog for managing ICA components&lt;br /&gt;
|-&lt;br /&gt;
| MAINImportASCII || import an ASCII file into a ''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'' file.&lt;br /&gt;
|-&lt;br /&gt;
| MAINMarkBlock || mark a data block (optionally send to Source Analysis)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMarkChannels&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || mark one or more channels, as given by the list&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMaxInInterval&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || within the current marked block, search for the largest absolute value on the specified channel&lt;br /&gt;
|- &lt;br /&gt;
| MAINMontage || change the montage (used by the Export command when saving to current montage)&lt;br /&gt;
|-&lt;br /&gt;
| MAINParadigm || load a paradigm file&lt;br /&gt;
|-&lt;br /&gt;
| MAINPatternToTrigger || convert a tag into a trigger&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINPolygraphicFilters&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || sets filters for polygraphic or added channels&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINScale&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set amplitude and time scales&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSearchAverageView&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start search average view&lt;br /&gt;
|-&lt;br /&gt;
| MAINSendToMATLAB || send data to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSplineConstant&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the spline constant used in spherical spline maps and channel interpolation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerRecode&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the command recodes a specified trigger number to a new number&lt;br /&gt;
|-&lt;br /&gt;
| MAINTriggerSelect || edit the trigger list (cf. ''Edit / Trigger Values''...)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerTagDelete&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || delete one or more triggers or tags&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewAverageBuffer&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turn on the Average Buffer View and place the specified buffer number to the left in the display&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewChannelType&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || select the channel type to display, and select channel types for mapping, export, etc&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewSelected&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns selected view on or off&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands for Source Analysis''' - prefixed with &amp;quot;'''SA'''&amp;quot; (but see also ''MarkBlock'', which is used to send a block of data to SA and open the SA window):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| SAAddSource || add a dipole or regional source to a model&lt;br /&gt;
|-&lt;br /&gt;
| SAChannelTypeForFit || switch between EEG, magnetometers or axial gradiometers, and planar gradiometers&lt;br /&gt;
|-&lt;br /&gt;
| SAConvertSource || convert a source from dipole to regional source, or from regional source to dipole&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalClara || run Cortical CLARA&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalLoreta || run Cortical LORETA&lt;br /&gt;
|-&lt;br /&gt;
| SADelete || delete current solution or all solutions or remove current fit interval or cursor&lt;br /&gt;
|-&lt;br /&gt;
| SADICS || start DICS computation (if DICS has been precomputed in the time-frequency image command)&lt;br /&gt;
|-&lt;br /&gt;
| SADisplayMRI || switch MRI display on/off and select small or large window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAElectrodeConfiguration&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || equivalent to pressing the Org or Std button in the Channel box of the Source analysis window&lt;br /&gt;
|-&lt;br /&gt;
| SAExit || close Source Module&lt;br /&gt;
|-&lt;br /&gt;
| SAFit || start fit&lt;br /&gt;
|-&lt;br /&gt;
| SAFitConstraint || set fit constraints, e.g. Residual Variance, Energy, Maximum Distance, Image Weighting, and their weights.&lt;br /&gt;
|-&lt;br /&gt;
| SAFitInterval || set fit or baseline interval&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAHeadModel&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the head model&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SALabelSource&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the label of the specified source number&lt;br /&gt;
|-&lt;br /&gt;
| SAMinimumNorm || run a minimum norm analysis&lt;br /&gt;
|-&lt;br /&gt;
| SANewSolution || open a new solution&lt;br /&gt;
|-&lt;br /&gt;
| SAOpenSolution || open a solution from a file&lt;br /&gt;
|-&lt;br /&gt;
| SAPCA || toggle PCA display of data or residual, and transfer a selected number of components to the source model&lt;br /&gt;
|-&lt;br /&gt;
| SARegularization || set the regularization values both for discrete and distributed source images&lt;br /&gt;
|-&lt;br /&gt;
| SASaveBitmap || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| SASaveLeadfields || save the leadfields of the current source model&lt;br /&gt;
|-&lt;br /&gt;
| SASaveModelWaveforms || save model waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveResidualWaveforms || save residual waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveRVandGFPWaveforms || save residual variance and global field power waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSolution || save the current solution&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceMontage || save a source montage&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceWaveforms || save source waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASendToMATLAB || send data, model, source waveforms, images, etc. to Matlab&lt;br /&gt;
|-&lt;br /&gt;
| SASetCursor || set the cursor&lt;br /&gt;
|-&lt;br /&gt;
| SASetDefaultSourceType || set the default source type (dipole or regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrActivateSource || Turn specified source on or off, or enable/disable source for fitting&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrientation || set orientation (of regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASwitchCondition || switch to a specified condition&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Distributed 3D Volume Images'''&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| SAIMAGEBeamformer || switch between Single Source and Bilateral Beamformer image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAIMAGEBeamformerTimeDomain&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start beamformer computation in the time domain&lt;br /&gt;
|-&lt;br /&gt;
| SAimageBrainAtlas || turns on the Brain Atlas overlay on volumetric image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGECLARA || generate CLARA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip image values under a threshold&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEExport || save the results of minimum norm or 3D imaging method&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEGotoMax || set the crosshair cursor at the nth maximum in the image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEImport || load a 3D volume image from file&lt;br /&gt;
|-&lt;br /&gt;
| SAimageImportFMRI || import fMRI image to Source Analysis Module&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELAURA || create LAURA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELORETA || create LORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESLoreta || create sLORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAimageSESAME || start SESAME computation&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESSLOFO || create SSLOFO image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEUser-Defined || create user-defined image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESaveLeadfields || save the leadfields of all the voxel sources in a 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESmooth || smooth current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESetCrosshair || set the position of the crosshair in the 3D image&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Time-Frequency Analysis''' ('''TFC''')&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot; &lt;br /&gt;
| style=&amp;quot;width: 180pt&amp;quot;| TFCStartTFAnalysis ||(previously TFCgo) start TFC analysis using the current paradigm settings&lt;br /&gt;
|-&lt;br /&gt;
| TFCdisplay || change the TFC display (e.g. power/amplitude, coherence)&lt;br /&gt;
|-&lt;br /&gt;
| TFCsave || save numerical results to an ASCII file, or save a screenshot of the TFC window&lt;br /&gt;
|-&lt;br /&gt;
| TFCimage || start beamformer analysis on a selected time-frequency range&lt;br /&gt;
|-&lt;br /&gt;
| TFCSendToMATLAB || send TF results or single-trial data to MATLAB&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How to Average Your Data in a Batch  ===&lt;br /&gt;
&lt;br /&gt;
Using batch processing, several files from an experiment can be averaged at a time.&lt;br /&gt;
&lt;br /&gt;
Here we summarize the steps required:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Create the paradigm, and save the paradigm file.&lt;br /&gt;
* Open each individual data file to check the data:&lt;br /&gt;
** Make sure auxiliary files are defined and loaded properly, and the data are displayed correctly.&lt;br /&gt;
** Eyeball the data.&lt;br /&gt;
** Define bad (and interpolated) channels.&lt;br /&gt;
** Mark artifact time ranges.&lt;br /&gt;
** If required, set up artifact correction for the file.&lt;br /&gt;
** The data file can be closed again after this step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Preparing the batch'''&lt;br /&gt;
&lt;br /&gt;
* Open at least one&amp;amp;nbsp;file and select ''Process / Batch Scripts''.... The file(s) should be displayed in the file list. Alternatively, just select ''Process / Batch Scripts...,'' and add the files by&lt;br /&gt;
** pressing the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** dragging the files from Windows Explorer&lt;br /&gt;
** Opening a previously saved&amp;amp;nbsp;list with ''Load File List''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* You can delete files from the list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt;) or edit the file sequence using the right click context menu.&lt;br /&gt;
* Select the ''Batch Tab''.&lt;br /&gt;
* Add commands to your script. For averaging, these would normally be&lt;br /&gt;
** '''Paradigm''' -- to load the paradigm file&lt;br /&gt;
** '''Artifact Scan''' -- to run the artifact scan&lt;br /&gt;
** '''Average''' -- to perform the average&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Save these commands (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Test the commands on the files in the current file list: press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Look at the log file (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;) to check the results of averaging.&lt;br /&gt;
* Look at the data averages to make sure they have been done correctly.&lt;br /&gt;
* Repeat these steps until averaging is working properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Select ''Process / Batch Scripts''....&lt;br /&gt;
* Open the files you want to average in the batch in the file list:&lt;br /&gt;
** Any files that were open in BESA are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Edit the file list, e.g. delete unwanted files (use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; key or the right click context menu), or reorder the files (use &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl + cursor keys'''&amp;lt;/span&amp;gt; or context menu).&lt;br /&gt;
* Note that the order of files in the list specifies the order in which they will be processed in the batch script. This order will be important if all results are saved to the same target file. Otherwise the file sequence is not important.&lt;br /&gt;
* Optionally, save the file list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Select the ''Batch Tab'', and load the previously defined batch script with ''Load Batch''.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch.&lt;br /&gt;
&lt;br /&gt;
=== How to Merge and Compress raw data  ===&lt;br /&gt;
&lt;br /&gt;
Using the Export command in a batch, several data files can be merged into a single data file in BESA's data format (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.foc&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This can be useful if data from one subject have been collected in several data blocks, and you want to analyze all data blocks together.&lt;br /&gt;
&lt;br /&gt;
Optionally, to save space, data can be saved in compressed format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Files can be merged:'''&lt;br /&gt;
&lt;br /&gt;
* if they have identical channel configurations, or&lt;br /&gt;
* there are at least 16 EEG channels, and the export format is Standard 81 (i.e. EEG channels are interpolated to 81 standard locations). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''How to merge files:'''&lt;br /&gt;
&lt;br /&gt;
* Select '''Process / Batch Scripts...'''&lt;br /&gt;
* Add all the files that are to be merged to the file list:&lt;br /&gt;
** Any files that were open in BESA Research are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list (''Load File List'').&lt;br /&gt;
* Rearrange the files in the file list to the sequence in which they should be merged.&lt;br /&gt;
* Select the ''Batch Tab ''and insert an &amp;quot;''Export&amp;quot;'' command, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following dialog shows a possible configuration of the ''Export'' command:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The parameters shown in the Information box are the settings chosen in the ''Export Dialog'' when the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt; button has been pressed.&lt;br /&gt;
* '''Append if file already exists''' must be checked in order to merge the files.&lt;br /&gt;
* The '''target file name''' must be fixed, i.e. don't use the '''%basename%''' variable, because that will result in a different target file name for each source file.&lt;br /&gt;
* There are two variables that can be used for the segment label:&lt;br /&gt;
** '''%filename%''' will insert the basename of the source file into the segment label.&lt;br /&gt;
** '''%c%''' will insert the file number into the segment label. The number gives&amp;amp;nbsp;the position of the file in the file list. For instance, &amp;quot;File %c%&amp;quot; will generate the label &amp;quot;File 2&amp;quot; for the second file in the list.&lt;br /&gt;
&lt;br /&gt;
=== Example: Data averaging in the auditory intensity experiment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, two raw data files, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;, from the auditory intensity experiment will be batch averaged.&lt;br /&gt;
&lt;br /&gt;
Please note that there are further tutorials covering this experiment. The first file is contaminated by many eyeblinks, and more epochs would be averaged if eye correction were used (see Viewlet demonstration on artifact correction on the BESA website). However, in this tutorial we will just use artifact rejection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Various ways of creating a File List'''&lt;br /&gt;
&lt;br /&gt;
1. '''Files that were open in BESA Research are automatically added to the File List.''' Start BESA Research and open the files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt '''&amp;lt;/span&amp;gt;in the directory ''Examples\ERP-Auditory-Intensity''.&lt;br /&gt;
&lt;br /&gt;
2. Select ''Process / Batch Scripts''.... You should see the file names in the '''''File List Tab''''' something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. You can resort the files in the file list alphabetically by clicking onto the '''''File List column header''''':&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can mark any file, hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;key and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrow '''&amp;lt;/span&amp;gt;to move the file name up or down the list. This is the sequence in which files will be processed in the batch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; and save the list you have created to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Highlight both names and press the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
6. '''Files can be dragged from Windows Explorer'''. Start Windows Explorer and navigate to the ''ERP-Auditory-Intensity'' subdirectory of your BESA Research examples folder (located in the ''Public Documents'' folder of your computer). Click on &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and drag it with the mouse onto the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''''File List Tab'''''. Let go of the mouse. BESA Research opens the file, and displays the name in the File List. Repeat for &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt.'''&lt;br /&gt;
&lt;br /&gt;
7. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
8. '''Files can be added using the ''Add File'' button'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; and navigate to the ''Examples\ERP-Auditory-Intensity'' subdirectory. Select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt;. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl'''&amp;lt;/span&amp;gt; and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;. Both names should then be displayed in the ''File Open'' dialog. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to add the files to the file list.&lt;br /&gt;
&lt;br /&gt;
9. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
10. '''Files can be loaded from a previously saved file list'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List '''&amp;lt;/span&amp;gt;and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;, the list you saved in step 6 above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Setting up the batch'''&lt;br /&gt;
&lt;br /&gt;
1. We will add three commands, '''Paradigm''', '''Artifact Scan''', and '''Average''', to create a batch that will be applied to the two files in the file list.&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''Batch Tab'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button to obtain the ''Select Command'' window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (9).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt; and then on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; (alternatively, double-click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt;). Hit &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Browse'''&amp;lt;/span&amp;gt;, navigate to the ''Auditory'' folder, and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''AEP_Intensity.pdg'''&amp;lt;/span&amp;gt;, the paradigm for the auditory intensity experiment.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (10).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to obtain the ''Load Paradigm Task'' window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (11).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;, and the first task in the batch is ready, and listed in the Batch Command window. If you want to modify the command, double-click on it to open the above window, that allows to browse for a different paradigm file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (12).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Next, we add the '''Artifact Scan''' command. Click on the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select ''Artifact Scan.''&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (13).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Artifact Scan Task'' window. We want to be able to view the results of the scan, and adjust thresholds and bad channels if necessary. Therefore, check the ''Wait after scan'' checkbox.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (14).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to close the ''Artifact Scan Task'' window. Our batch now contains two commands.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (15).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Finally, we will add an '''Average''' command. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button and select ''Average''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Average Task ''window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (16).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. With the default settings, the average would be saved to the same directory as the data. The file name mask is set by default so that in this example the two averages would be saved to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1-av.fsg '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2-av.fsg'''&amp;lt;/span&amp;gt;. We will save the averaged files to subdirectory ''&amp;quot;Averages''&amp;quot; of the data directory. Uncheck the ''Use default target'' check box, change the File name mask to '''%basename%_av-test''' in order not to overwrite the predefined files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (17).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Average Task'' window. Our batch is now complete.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (18).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
13. We will now save the batch so that it can be used again. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt; button, and save to the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-ex1.bbat'''&amp;lt;/span&amp;gt;. Note that an easy way to generate new averaging batches is to load a previously save batch and edit the commands -- it may only be necessary to edit the '''Paradigm''' command to select the relevant paradigm file, and maybe to adjust the target directory in the '''Average''' command.&lt;br /&gt;
&lt;br /&gt;
14. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch'' Window to start the batch running. As requested, the batch pauses after the artifact scan:. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (19).gif]]&lt;br /&gt;
&lt;br /&gt;
You may now adjust the number of rejected trials, e.g. by moving the vertical red bar to the left, or exclude bad channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to continue with averaging.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (20).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
16. Note that, in the background, the ''Batch Running'' window is providing feedback about the current file and current task.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
17. The batch will stop again after the next artifact scan. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to allow the batch to run to the end.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (21).gif|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
18. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log'''&amp;lt;/span&amp;gt; to view the batch protocol. If you are using Internet Explorer or Netscape family (Mozilla, Firefox) browsers, and JavaScript is enabled, you will first see just batch titles defined by the date and time the batch was started. The most recent title is at the top of the list. For other browsers, or if JavaScript was not enabled, all protocol texts are expanded as in 19 (below).&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (22).gif|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
19. Click on the first title to expand its protocol. Here, for example, the protocol gives feedback about the number of epochs that were averaged for each file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (23).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
20. Finally, press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to return to the main BESA Research display. Open the averages in the ''Averages'' subdirectory to confirm that they were generated properly.&lt;br /&gt;
&lt;br /&gt;
=== Example: Merging files using the Export Command ===&lt;br /&gt;
&lt;br /&gt;
Here we will demonstrate the use of the '''Export '''command to merge two files. We will combine the two averages from the previous example (Data averaging in the auditory intensity experiment) into one target file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Generate the file list'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and load the two data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av-test.fsg'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2_av-test.fsg'''&amp;lt;/span&amp;gt; that were saved in the previous example.&lt;br /&gt;
# Select ''Process / Batch Scripts....''The two file names should be displayed in the file list.&lt;br /&gt;
# In the file list, make sure that &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1_av-test.fsg '''&amp;lt;/span&amp;gt;is the first file in the list. If it is not, highlight the file, and move it up using &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl+up'''&amp;lt;/span&amp;gt;, or right click and select ''Move Up'' in the context menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Generate the batch'''&lt;br /&gt;
&lt;br /&gt;
1. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select the '''Export''' command.&lt;br /&gt;
&lt;br /&gt;
2. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Export Task'' window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (24).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt;... button to open the ''Export Dialog''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (25).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Since we are combining averages, select ''Hires (no compression)'' in the '''Target data format''' drop-down list (If we were merging raw data files, it is better to select compression. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the dialog. Check'' Append if file already exists'', so that the files will be merged. Enter '''s1+s2''' in the target file name mask edit box. This ensures that both files will be saved to the same target: &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (26).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Export Task'' window. The '''Export '''command is displayed. &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (27).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Optionally, you may save the batch file by pressing &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
7. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch, and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch Completed'' window to return to the BESA main window.&lt;br /&gt;
&lt;br /&gt;
8. Finally, open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt; to confirm that it contains the two merged files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Merge raw data'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Repeat the above task to merge the two raw data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2.cnt'''&amp;lt;/span&amp;gt; into a single target file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.foc'''&amp;lt;/span&amp;gt;. In this case, select one of the compression options as the target data format. Note that you would not normally want to merge two files from different subjects. However, several data blocks from the same subject can conveniently be merged using this method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; files can also be merged using the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''Combine Conditions''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; dialog. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions, Channels ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Combine Condition Scripts ===&lt;br /&gt;
&lt;br /&gt;
With the Combine-Conditions module you can do a variety of operations on BESA averages (files with the extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, and other segment files, such as &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.mul&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.swf&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* Create grand averages&lt;br /&gt;
* Combine averages (add, subtract, weighted/unweighted)&lt;br /&gt;
* Merge files&lt;br /&gt;
* Exclude unwanted averages&lt;br /&gt;
* Rename conditions&lt;br /&gt;
* Rename or resort channels&lt;br /&gt;
* Generate averages or differences over selected channels&lt;br /&gt;
* Transform the data: standard interpolated 81 electrodes, change sampling rate, change interval&lt;br /&gt;
* Determine peaks, mean amplitudes, or integrals on data averages&lt;br /&gt;
* These operations can be performed on one or more files simultaneously. Results of an operation are stored in a single target file.&lt;br /&gt;
&lt;br /&gt;
The module includes four tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* File List: Define a list of files on which the operations will be performed.&lt;br /&gt;
* Condition List: List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
* Channel List: List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
* Run Scripts: Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak analysis). Start the operation.&lt;br /&gt;
* Note that in all four tabs, configurations can be saved for future use, and the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button restores the most recently used configuration.&lt;br /&gt;
&lt;br /&gt;
=== Condition List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
&lt;br /&gt;
The first column of the&amp;amp;nbsp;list box shows a list of all the condition names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the source conditions. Columns define the target conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each condition name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target conditions will have the same name as source conditions. Right click on source condition labels to view properties (e.g. no. of samples, time range, sampling rate).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (28).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the condition list'''&lt;br /&gt;
&lt;br /&gt;
* Target condition names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: conditions can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over conditions, the sum is divided by the number of conditions, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;''Divide the result by the sum of PLUS factors''&amp;quot; is unchecked, the conditions will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between conditions, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the condition list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Weighting of averages'''&lt;br /&gt;
&lt;br /&gt;
* Below the list, click on the ''Weighted Average'' row to toggle &amp;quot;YES&amp;quot; and &amp;quot;NO&amp;quot;. &amp;quot;YES&amp;quot; means that averages will be weighted by the number of epochs contributing to the average. For instance, if average A contained 100 epochs and average B contained 200 epochs, the weighted average will be computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(100 * A + &amp;amp;nbsp;200 * B) / (100 + 200)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Select &amp;quot;NO&amp;quot; for an unweighted average. For the above example, the average is computed as&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(A + B) / 2&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Weighted averages are not permitted if one of the boxes contains a negative value.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Values other than +1 or -1 in the boxes apply a different kind of weighting. For instance, we want to compute the difference between the means of conditions A, B, C and D, E. Use a right-click to specify the fraction 1/3 for each of A, B, and C, and -1/2 for each of D and E (see example below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (29).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Feedback'''&lt;br /&gt;
&lt;br /&gt;
* Conditions that have different numbers of electrodes (averaging across different files) can only be combined if channels are interpolated to a standard set of electrodes.&lt;br /&gt;
* Conditions that have different durations or sampling rates can only be combined if the sampling rate and durations are made the same.&lt;br /&gt;
* Feedback about the above situations is displayed by the presence of tick marks above the list box.&lt;br /&gt;
&lt;br /&gt;
=== Channel List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
&lt;br /&gt;
Note that this tab is very similar in usage to the '''Condition List Tab'''. Note also that some of the functions performed in this tab could also be done in the Montage Editor. It may be a matter of convenience whether you choose to perform these operations here or in the Montage Editor.&lt;br /&gt;
&lt;br /&gt;
The first column of the list box shows a list of all the channel names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the ''source'' channel. Columns define the'' target'' channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each channel name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target channel will have the same name as source channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Combining files'''&lt;br /&gt;
&lt;br /&gt;
If files with different channel configurations are included in the File List, the rows and columns of the Channel List Tab will only contain the labels for the channels that are in common among the files.&lt;br /&gt;
&lt;br /&gt;
If the files in the File List have a different sequence of channels, the sequence of the first file in the list will be adopted in the Channel List.&lt;br /&gt;
&lt;br /&gt;
Thus, for the initial setting, unless the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked, the target grand average or peak/amplitude analysis, etc. will be applied using only channels that are in common among the input files, and using the channel sequence of the first file in the File List. By changing the target channels or by changing the entries in the Channel List, new channels consisting of averages or differences can be generated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''What can the Channel List be used for?'''&lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
&lt;br /&gt;
* Reorder or relabel channels&lt;br /&gt;
* Create channel differences&lt;br /&gt;
* Create averages over channel groups, e.g. for peak analysis&lt;br /&gt;
* Extract a selection of channels for peak analysis or mean amplitudes&lt;br /&gt;
* Create grand averages across files with different channel configurations, just using channels in common among the files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (30).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the channel list'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Target channel names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: channels can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over channels, the sum is divided by the number of channels, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;Divide result by the sum of PLUS factors&amp;quot; is unchecked, the channels will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between channels, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the channel list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Channel List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Channel List&amp;amp;nbsp;'''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
=== Run Scripts Tab ===&lt;br /&gt;
&lt;br /&gt;
Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak detection. Start the operation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load or Save Settings'''&lt;br /&gt;
&lt;br /&gt;
* You can save the current settings of this tab to a file (*.run) which can be loaded later.&lt;br /&gt;
* When you run the script, the current settings are saved automatically to a file &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* Press this button to load the previous settings (from &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Averages to Generate'''&lt;br /&gt;
&lt;br /&gt;
* '''Generate separate averages for each source file'''. Averages are performed over conditions within the source file, and are then appended to the target file.&lt;br /&gt;
* '''Combine data from source files'''. Conditions are combined over all source files into a single target average.&lt;br /&gt;
* '''No averages, just copy'''. Files are copied and merged to the target file. Use this option for renaming conditions, merging files, removing unwanted averages (see below), changing the sampling rate and interval.&lt;br /&gt;
* '''Peaks and mean amplitudes'''. Specify time ranges for peaks, mean amplitudes, or integrals (areas).&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note: When generating or copying averages (first three options), filters and baseline settings are turned off. For Peaks and mean amplitudes, filters and baseline settings are specified in the dialog.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Spatial Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Interpolate to Standard 81 electrodes'''. The target file will contain only electrodes (other channels are omitted), using the Standard 81 configuration (as in other export functions within BESA Research). This cannot be selected if the source data contain less than 16 EEG channels.&lt;br /&gt;
* '''Interpolate Bad Channels'''. Bad electrode channels in the source file will be interpolated. If the above option is deselected and bad channels exist in one or more of the source files, this option is always on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;BESA Research can interpolate EEG, and MEG if the sensors are axial gradiometers or magnetometers. If other channels are marked as bad in one or more of the source files, these will be defined as bad in the target file. This applies to MEG planar gradiometers, to polygraphic data, and to ICR channels.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Temporal Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Spline to New Sampling Rate and Interval'''. Data can be converted to a new sampling rate, and the interval can be changed.&lt;br /&gt;
** If the sampling rate is reduced, the data will be low-pass filtered at 1/3 sampling frequency before reduction.&lt;br /&gt;
** If the sampling interval is changed, the prestimulus and poststimulus intervals are limited by the smallest intervals in the conditions contributing to the averages. These limits are shown below the edit boxes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks and Mean Amplitudes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (31).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range between which peaks are to be determined.&lt;br /&gt;
* Select the montage on which the peaks are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Define the baseline settings.&lt;br /&gt;
* Specify whether peaks are to be defined at one latency: if so, select the channel on which peaks are to be detected.&lt;br /&gt;
* Specify whether you want to find positive or negative peaks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Mean amplitudes and areas:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range over which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Select the montage on which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Note that when computing areas, data are first rectified (made positive) and then summed over the time range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Output options of the analysis:'''&lt;br /&gt;
&lt;br /&gt;
* A single ASCII file that contains the result of the analysis for all data sets, conditions, and channels including header and information lines.&lt;br /&gt;
* A sparse output suitable for import in SPSS. Each variable (e.g. a latency, a channel amplitude) constitutes one column of the output file.&lt;br /&gt;
* Direct transfer to MATLAB into a struct besa_peak. For more information on the data transfer from BESA Research to MATLAB, please refer to help chapter ''“The MATLAB interface”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Starting the Operation'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;to start the operation. After the operation is completed, and the &amp;quot;Open target file in BESA&amp;quot; box is checked, BESA Research will open the target file. &amp;amp;nbsp;&amp;quot;Open target file in BESA&amp;quot; cannot be checked if &amp;quot;Peaks and mean amplitudes&amp;quot; was selected - then the result of the operation will be an ASCII file or a MATLAB transfer.&lt;br /&gt;
* You will be asked for the name of the target file (unless a MATLAB transfer of peak data has been performed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Restrictions'''&lt;br /&gt;
&lt;br /&gt;
* Depending on source file configurations, not all options above are selectable. For instance, if two files contain different numbers of electrodes, and the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked in the '''''Channel List''''' Tab, spatial interpolation to Standard 81 is enforced in the target. Similarly, if different sampling rates are used in different files, temporal interpolation is enforced.&lt;br /&gt;
* You are not allowed to add files to the file list if the channel configuration is different, and the data cannot be combined with Standard 81 interpolation. Since Standard 81 interpolation is only possible for EEG, multiple files without EEG can only be loaded if they have the same number of channels.&lt;br /&gt;
&lt;br /&gt;
=== How to Create Grand Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to average in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To average across different conditions, click in the list boxes to obtain &amp;quot;+1&amp;quot; for each source condition to combine, and rename the target condition to define a meaningful name for the average.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Generate Differences Between Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To create differences, click in the list boxes to obtain &amp;quot;+1&amp;quot; for one of the source conditions, and &amp;quot;-1&amp;quot; for the source condition to subtract, and rename the target condition to define a meaningful name for the difference.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. An average of the differences is generated. If only one example of each condition exists, e.g. in a grand average file, the result is the difference between conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Merge Files ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to merge in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notes'''&lt;br /&gt;
&lt;br /&gt;
* If the source files have different electrode configurations, use the Standard 81 configuration for the target.&lt;br /&gt;
* If the source files have different sampling rates or intervals, use Temporal Interpolation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Remove Unwanted Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted segments'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as averages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted conditions (by label)'''&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Deselect the target conditions you want to omit (replace the &amp;quot;+1&amp;quot; by a blank).&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as artifacts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Rename Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. Click on column headings to rename the target conditions.&lt;br /&gt;
* Click on the''' Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data with the renamed conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Change the Sampling Rate ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file(s) you want to change in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...'').&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Select &amp;quot;''Spline to New Sampling Rate and Interval''&amp;quot; and type the new sampling rate into the edit box.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Create grand average and combinations of conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, we will generate a grand average of the results of the Auditory Intensity Experiment. The experiment includes averages from five different stimulus intensities. We will create a grand average over each intensity, but also include means over the two lowest and the two highest intensities, and the difference between these two combinations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av.fsg - S10_av.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The files contain the individual averaged data of the 10 subjects who participated in this study.&lt;br /&gt;
# Select ''ERP / Combine Conditions...'' The file list should display the two files, with feedback about the number of averages and conditions. 8 epochs are found. See the ''“Data averaging in the auditory intensity'' ''experiment”'' example for examples how to manipulate the file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (32).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. The initial window defines target conditions with the same name as the source conditions. To generate the grand average over these conditions we could proceed without further changes to the '''Run Scripts Tab'''. However, we want to modify the condition list and create a condition that contains the grand averaged difference between the''' High''' and '''Low''' conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''All '''column label. In the resulting window, rename condition '''All''' to''' Difference'''. Then press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (33).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. The last column is now labeled '''Difference.''' Left-click twice onto the ‘'''+1’''' entry that links this condition to the '''All '''input condition. This will remove the link and leave the field blank. To define the ‘Difference’ condition as the average of ‘High’ minus ‘Low’ over subjects, left-click once into the field linking input '''High''' with target '''Difference''' to generate an entry ‘'''+1’''' in this field. Left-click twice into the field linking input '''Low '''with target '''Difference''' to generate an entry '-'''1'''’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;[[Image:Batch processing (35).gif]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; and save the list to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ER&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;P-aud-ex1.clist'''&amp;lt;/span&amp;gt;. This condition combination can thus be loaded later using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Click on the '''Run Script Tab'''.&lt;br /&gt;
# The default tab settings are ready for generating the grand average ('''Combine data from source file''' and '''Open target file in BESA''' should be checked). Just press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Enter &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_cc-test.fsg'''&amp;lt;/span&amp;gt; as file name and press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Save'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The resulting file contains the 8 target conditions, 60db, 70dB, 80dB, 90dB, 100dB, Low, High, and Difference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Average files from different experiments ===&lt;br /&gt;
&lt;br /&gt;
This example is intended to illustrate several features of the ''Combine Conditions'' Dialog, such as electrode interpolation and resampling. We will combine an average from the Auditory Intensity experiment with one from the P300 auditory experiment. In this particular case, it is not a very meaningful thing to do, but it shows what is possible. For instance, the same experiment may have been performed using different sampling rates or electrode combinations. This example shows how such data may be combined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_GA.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The file contains the grand average data from the auditory intensity experiment.&lt;br /&gt;
# Open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''RareFrequentResponseLeft.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-P300-Auditory'' folder. This file contains averages from the P300 auditory experiment.&lt;br /&gt;
# Select ''ERP / Combine Conditions... ''Note that the files have different sampling rates and different numbers of electrodes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (36).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. Note that the feedback text at the bottom of the window displays the text &amp;quot;Standard 81 interpolation required to generate average; Across files: resampling or change in time range required to generate average&amp;quot;. The condition labels show all the names from both files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (37).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.  We will exclude most conditions, and just combine the most similar conditions from the two experiments: the &amp;quot;Standard&amp;quot; and the &amp;quot;80dB&amp;quot; conditions. Click on the title of the first column,''' Blink'''. Select “''Delete all conditions to the right of this column”'', and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (38).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on the title again, and rename the target condition to &amp;quot;Standard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (39).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click twice in the first line to remove the &amp;quot;+1&amp;quot; entry there. Click once in the third row (&amp;quot;Frequent&amp;quot;), and in the 7th row (&amp;quot;80dB&amp;quot;), to display &amp;quot;+1&amp;quot; at each entry. Thus, just two of the conditions will be combined into one target condition.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (40).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Run Script Tab'''. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (41).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Note that '''Interpolate to Standard 81 electrodes''' is checked and grayed: since two different electrode sets are to be combined, we can only do this by interpolating electrodes. Also, both '''Spline to new sampling rate''' and '''Clip interval '''are checked and grayed. Again, these settings are required in order to be able to average the two data files together. The sampling rate is set to the higher of the two selections. The time range is set to the largest possible range that can be clipped from the two data sets. For now, leave these settings as they are, and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Save the target to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''TestCombineExpts_CC-std81.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing</id>
		<title>BESA Research Batch Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing"/>
				<updated>2021-05-05T07:45:10Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* Batch Commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==  Batch Processing and Combining Conditions == --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions and Batch Module: Introduction ==&lt;br /&gt;
&lt;br /&gt;
Functions of this module are started by selecting the menu operations &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Combine Conditions...'''&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Batch Scripts...'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''Combine Condition Scripts''' provides various operations on BESA averages.&lt;br /&gt;
* '''Batch Scripts''' provides batch operations on all data files.&lt;br /&gt;
* Note that a batch script can also be performed on the current file by selecting &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Run Batch...'''&amp;lt;/span&amp;gt;&amp;quot; or by typing the shortcut key &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''R'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== File List Tab ==&lt;br /&gt;
&lt;br /&gt;
Define a list of files on which the operations will be performed. The tab is the same for Combine Conditions Scripts and for Batch Scripts. Combine Conditions Scripts only allows you to open BESA average files (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, but also &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.raw'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.swf'''&amp;lt;/span&amp;gt;, and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt; if the files have a defined pre-stimulus interval), whereas Batch Scripts allows you to open any data file whose format is known to BESA Research.&lt;br /&gt;
&lt;br /&gt;
When the Combine-Conditions or the Batch module is started, all currently opened (Combine-Conditions: averages only) files are displayed in the list.&lt;br /&gt;
&lt;br /&gt;
To the right of each file name, the number of electrodes, total number of channels, and the sampling rate used in the file are displayed. In the Combine-Conditions module, the number of Epochs (segments) and the number of differently-named conditions are also shown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add files to the list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File '''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
* Drag one or more files from Windows Explorer onto the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Remove files from the list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and confirm the delete operation in the resulting dialog.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key to mark multiple files). Right click to obtain the context menu and select &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;quot;, or just press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Reorder files within the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctr'''&amp;lt;/span&amp;gt;l key to mark multiple files). Right click to obtain the context menu and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;, or hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key '''and '''press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrows'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sort the current file list alphabetically'''&lt;br /&gt;
&lt;br /&gt;
* Click on the File bar above the list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List'''&amp;lt;/span&amp;gt; button, or the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button to load the most recently used file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Which conditions are read from a source file? (Combine-Conditions module only)'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File list from Combine Conditions:'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (1).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Don't try to open here... (Batch only)'''&lt;br /&gt;
&lt;br /&gt;
By default, this checkbox is unchecked.&lt;br /&gt;
&lt;br /&gt;
In the checked state, BESA Research doesn't check if it can open the file. Use this function '''only''' if the file is ASCII and you want to use the '''ImportASCII '''batch command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File List from Batch Scripts''':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (2).png]]&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Batch Processing &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== Batch Processing Scripts ===&lt;br /&gt;
&lt;br /&gt;
With Batch Scripts, you can define a set of operations (e.g. Artifact Scan, Average, etc.) and apply these to several data files.&lt;br /&gt;
&lt;br /&gt;
These operations include&lt;br /&gt;
&lt;br /&gt;
* Load Paradigm&lt;br /&gt;
* Artifact Scan&lt;br /&gt;
* Average&lt;br /&gt;
* Export (and Merge)&lt;br /&gt;
* File Open (switch to another data file)&lt;br /&gt;
* Set filters&lt;br /&gt;
* Specify a montage (used, for example, for export to current montage)&lt;br /&gt;
* Run automatic eye and EKG artifact correction&lt;br /&gt;
* Define artifact topographies&lt;br /&gt;
* Turn artifact correction and view on and off&lt;br /&gt;
* Read and write events&lt;br /&gt;
* Edit default block epoch (for export around triggers)&lt;br /&gt;
* Edit triggers (for export around triggers)&lt;br /&gt;
* Mark a block for export, or send the block to Source Analysis or Top View&lt;br /&gt;
* Convert patterns to triggers&lt;br /&gt;
* Attach auxiliary files (e.g. elp, sfp) to the data file&lt;br /&gt;
* Send to MATLAB&lt;br /&gt;
* Specify display configurations for the BESA Research Main, SA, and Top View windows&lt;br /&gt;
* and more - see the full list of [[Batch Commands]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An additional set of commands are available for operations in the '''Source Analysis Module''', allowing to load, create and fit dipole models, and save the results.&lt;br /&gt;
&lt;br /&gt;
A further set of commands apply to '''Time-Frequency Analysis''', allowing to start TFC, change the display, save results, and run the beamformer or DICS analyses on a selected time-frequency range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
These operations will be extended in future program releases.&lt;br /&gt;
&lt;br /&gt;
The module includes two tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* '''File List''': Define a list of files on which the operations will be performed.&lt;br /&gt;
* '''Batch''': Define or load '''batch commands'''. Run the batch.&lt;br /&gt;
&lt;br /&gt;
=== Batch Tab ===&lt;br /&gt;
&lt;br /&gt;
Load or define batch commands, and then apply them to the files in the File List.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add Command'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; to add a new command to the batch. The following dialog is opened, showing the available commands:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Select the desired command and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; or double-click on the command. A dialog box is opened, allowing to specify individual command parameters.&lt;br /&gt;
* If you click on &amp;quot;Apply at beginning of batch&amp;quot; or &amp;quot;Apply at end of batch&amp;quot;, the command will only be run at the beginning or the end of a batch. You can use this, for example, at the end of a batch to start a MATLAB script to perform statistics on the results of the batch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load and Save Batch'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load a previously defined batch or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to save the current batch to a file (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.bbat&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load the most recently used batch file. Whenever a batch is run, the current set of commands is written to the file &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Previous.bbat in'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Scripts/Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; subdirectory. This file is loaded when you press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Clear All'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Clears all commands from the window.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''View Log File'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Each time a batch is run, BESA Research adds information about the batch to a log file, with headings showing the date and time the batch was started. The file is opened automatically in Internet Explorer if errors occurred during processing. Otherwise you may open the file by &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button here or in the dialog that is displayed at the end of batch processing. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The log file is saved in xml format, and a JavaScript is used to format the display in web browsers. JavaScript should be enabled in the browser to obtain an optimal display of the results. If JavaScript is enabled, the log file is displayed as a list of headings for each batch. Click on a heading to display the results of the corresponding batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;To open the log file in the Notepad, hold the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Shift '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;key down when pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Batch Command List'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Double-click on a command to edit it. See &amp;lt;/span&amp;gt;[[Batch Commands]]&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for descriptions of the dialogs that are opened to edit each command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Right click on a command to open a context menu allowing more options.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Move Up'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''and Move Down'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; can also be applied to multiple selections.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If you have made a multiple selection, the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button will delete all the marked commands. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;plus &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''cursor keys'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will move the marked commands up or down.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Comment'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove a semicolon (;) in front of the command, to deactivate or reactivate the command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Command Only at Start/End'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove the text &amp;quot;Start_&amp;quot; or &amp;quot;End_&amp;quot; in front of the command. With these prefixes, the command will only be performed when the first file (&amp;quot;Start_&amp;quot;) or the last file (&amp;quot;End_&amp;quot;) in the file list is being processed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Single Step Mode'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Check this item to step through the batch, one command at a time. A dialog is opened after each command, allowing to run the next command, continue the batch without single steps, or stop running the batch. See the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'' “Pause''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;” command for further details.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;During a batch, press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changes in batch written to database'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Checked by default. If this item is unchecked, file display settings, such as Montage setting and Artifact correction display, are not written to the database. When the file is next opened in BESA Research, the settings made in the batch are not retained.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Leave files in the file list open after running the batch'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If this item is checked, files in the file list will remain open after the batch. This is useful, for instance, if you want to open a set of files, specifying the same montage and/or filter settings for each file.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to start running the batch. Each command is then applied in succession to each file in the File List.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that, while a batch is running press and hold down the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The log file ===&lt;br /&gt;
&lt;br /&gt;
A protocol of each batch is written to the log file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Scripts/Log/Batch.xml.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File '''&amp;lt;/span&amp;gt;button, the file is opened in your default browser for xml files. The file will be opened automatically if there was an error during batch processing, unless you have used the ''BatchError'' batch command to suppress this behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''DHTML formatting of the log file'''&lt;br /&gt;
&lt;br /&gt;
The xml file is formatted using JavaScript (Dynamic HTML). If JavaScript is enabled in your browser, you will first see a list of batch protocol titles, labeled by the date and time at which the batch was started. The most recent batch is at the top of the list.:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).png|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the title to view the protocol for the corresponding batch:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''JavaScript and XP Service Pack 2'''&lt;br /&gt;
&lt;br /&gt;
By default, if the log file is opened in Internet Explorer after XP Service Pack 2 has been installed, IE will warn you with the message: &amp;quot;''To help protect your security, Internet Explorer has restricted this file from'' ''showing active content that could access your computer&amp;quot;.'' All the protocols in the log file are displayed. You may safely click on the options to allow active content in the log file, if you want to display the file as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Backup of the log file'''&lt;br /&gt;
&lt;br /&gt;
When the log file is written, a backup of the previous version is written to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml.bak'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the size of the log file exceeds 200 KB, it is renamed to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml_date_time'''&amp;lt;/span&amp;gt; (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.xml_2004-10-08_10-53-32'''&amp;lt;/span&amp;gt;), and a new version of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml'''&amp;lt;/span&amp;gt; is created.&lt;br /&gt;
&lt;br /&gt;
=== Placeholders ===&lt;br /&gt;
&lt;br /&gt;
A powerful feature of the batch commands is the ability to define file names and specify standard paths using placeholders. These are text strings enclosed by percentage (%) signs. They can be used in all batch commands where file names are specified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Basename'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Placeholder !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; width=&amp;quot;10%&amp;quot;|'''%basename%'''&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|replaced by the basename of the currently opened file.&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%basename-n%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the last &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%-nbasename%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the first &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasename%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list (it has the same meaning as %basename% if no MAINFileOpen batch command was used in command list)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%base%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file without the path&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbase%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list without the path&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%ext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%basefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%t%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: time since start of batch on current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%T%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: current date and time&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%label%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Replace label of the most recent marked block by the block label, not including no. of averages&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%LABEL%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
| Replace label of the most recent marked block by the block label, including no. of averages&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%scripts%'''&lt;br /&gt;
|replaced by the path to the Scripts folder.&lt;br /&gt;
|&amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard MATLAB scripts used by BESA Research.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%montages%'''&lt;br /&gt;
|replaced by the path to the Montages folder.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%examples%'''&lt;br /&gt;
|replaced by the path to the Examples folder.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''%basename%''' -- replaced by the basename of the data file in the File List. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''%basename-n%''' -- replaced by the basename of the data file in the File List, but removing the last &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%-nbasename%''' -- replaced by the basename of the data file in the File List, but removing the first &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%scripts%''' -- replaced by the path to the Scripts folder (e,g, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard Matlab scripts used by BESA Research).&lt;br /&gt;
&lt;br /&gt;
* '''%montages%''' -- replaced by the path to the Montages folder.&lt;br /&gt;
&lt;br /&gt;
* '''%examples%''' -- replaced by the path to the Examples folder.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Placeholders for folders'''&lt;br /&gt;
&lt;br /&gt;
The following placeholders are the same as those used in the [Folders] section of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Besa.ini'''&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The strings enclosed by percent signs (%) are placeholders for the following folders in English-language versions of Windows. Folder names are different for the system and for other language settings. BESA Research will substitute the placeholders by the appropriate folder name for the Windows system and the system language:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 10 (English)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%localapp%''' = &amp;quot;&amp;quot;C:\Users[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;&amp;quot;Desktop[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%publicprog%''' = &amp;quot;Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;&amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Desktop\[User]\Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir%'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 7 (English):'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%localapp%''' = &amp;quot;C:\Users\[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;Desktop\[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%publicprog%''' = &amp;quot;C:\Users\Public\Public Documents\BESA\Research_7_1&amp;quot;. This folder is directly accessible from the Windows Explorer under &amp;quot;Libraries\Documents\Public Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;&amp;quot;Libraries\Documents\My Documents\Research_7_1&amp;quot; or &amp;quot;Desktop\[User]\My Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir% &amp;amp;nbsp;'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Batch Commands ===&lt;br /&gt;
&lt;br /&gt;
Batch commands are selected when the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt;&amp;quot; button is pressed in the &amp;quot;Batch&amp;quot; Tab. The commands are subdivided into five categories: General commands, commands for the Main module, for the Source Analysis module, imaging commands in the Source Analysis module, and commands for Time-Frequency Analysis. The commands have prefixes,''' GEN''', '''MAIN''',''' SA''', '''SAIMAGE''', and''' TFC'''), which identify the category. For compatibility with older program versions, old batches without the prefixes are accepted.&lt;br /&gt;
&lt;br /&gt;
Detailed descriptions of each batch command are available in the electronic help chapter “''Batch Processing and Combining Conditions / Batch Processing / Batch Commands”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands''' - prefixed with &amp;quot;'''GEN'''&amp;quot; (can be used anywhere):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| GENBatchError || used to change program behavior when errors occur&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENBatchWindowPosition&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the position of the batch window relative to the main window&lt;br /&gt;
|-&lt;br /&gt;
| GENComment || comment in the batch script: no batch functionality&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABcommand || send a command string to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABwaitForVariable || tells BESA to wait until Matlab has created a variable with the specified name.&lt;br /&gt;
|-&lt;br /&gt;
| GENPause || pause batch operations, allowing step-by-step operations&lt;br /&gt;
|-&lt;br /&gt;
| GENFor/GENEndFor|| a programming language-like FOR loop&lt;br /&gt;
|-&lt;br /&gt;
| GENRunProcess || runs a command line process, e.g. an external program to perform part of the data analysis in the batch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENsaveBitmap&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SetVariable&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the value of the variable is inserted into subsequent batch commands where the text contains the name flanked by % signs&lt;br /&gt;
|-&lt;br /&gt;
| GENWindowPosition || set window size and positions to a selection of standard settings, e.g. for bitmap export&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for the Main Module''' - prefixed with &amp;quot;'''MAIN'''&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| MAINArtifactCorrect || run automatic artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactMethod || specify the method for artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactOn || turn artifact correction an artifact view on or off&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifact Scan || run an artifact scan as from the Paradigm Dialog&lt;br /&gt;
|-&lt;br /&gt;
| MAINAuxiliaryFiles || associate auxiliary files (e.g. *.''ela'', *.''sfp'') with the data file&lt;br /&gt;
|-&lt;br /&gt;
| MAINAverage || average the data&lt;br /&gt;
|-&lt;br /&gt;
| MAINBaseline || specify the parameters for baseline correction&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINDefineArtifactTopography&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || define an artifact topography&lt;br /&gt;
|-&lt;br /&gt;
| MAINEditDefaultEpoch || edit the default block epoch&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventRead || read events from an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventWrite || write events to an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINExport || export or append data in the selected target format&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINExportToBESAConnectivity&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || export data segments to BESA Connectivity&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFT || calculates the FFT spectrum of the marked data interval&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTmean || starts an averaging procedure which calculates the mean spectral properties in pre-defined regions&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTsave || saves FFT data (generated using the ''FFT Average option'' in the ''Average ''command) to disk (*.''fma)''&lt;br /&gt;
|-&lt;br /&gt;
| MAINFileOpen || close the current file and open a new file to which the remaining batch commands will be applied&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINFileClose&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || close the currently open file in a batch, provided it is not the current file in the File List&lt;br /&gt;
|-&lt;br /&gt;
| MAINFilter || set filters&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINfMRIArtifact&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns on the fMRI artifact removal&lt;br /&gt;
|-&lt;br /&gt;
| MAINGoTo || jumps with the cursor to the specified time point&lt;br /&gt;
|-&lt;br /&gt;
| MAINICA || starts ICA decomposition of data on the current screen &lt;br /&gt;
|-&lt;br /&gt;
| MAINICAsave || saves selected ICA components as topographies in a file&lt;br /&gt;
|-&lt;br /&gt;
| MAINICAselect || opens component selection dialog for managing ICA components&lt;br /&gt;
|-&lt;br /&gt;
| MAINImportASCII || import an ASCII file into a ''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'' file.&lt;br /&gt;
|-&lt;br /&gt;
| MAINMarkBlock || mark a data block (optionally send to Source Analysis)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMarkChannels&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || mark one or more channels, as given by the list&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMaxInInterval&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || within the current marked block, search for the largest absolute value on the specified channel&lt;br /&gt;
|- &lt;br /&gt;
| MAINMontage || change the montage (used by the Export command when saving to current montage)&lt;br /&gt;
|-&lt;br /&gt;
| MAINParadigm || load a paradigm file&lt;br /&gt;
|-&lt;br /&gt;
| MAINPatternToTrigger || convert a tag into a trigger&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINPolygraphicFilters&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || sets filters for polygraphic or added channels&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINScale&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set amplitude and time scales&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSearchAverageView&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start search average view&lt;br /&gt;
|-&lt;br /&gt;
| MAINSendToMATLAB || send data to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSplineConstant&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the spline constant used in spherical spline maps and channel interpolation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerRecode&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the command recodes a specified trigger number to a new number&lt;br /&gt;
|-&lt;br /&gt;
| MAINTriggerSelect || edit the trigger list (cf. ''Edit / Trigger Values''...)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerTagDelete&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || delete one or more triggers or tags&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewAverageBuffer&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turn on the Average Buffer View and place the specified buffer number to the left in the display&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewChannelType&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || select the channel type to display, and select channel types for mapping, export, etc&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewSelected&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns selected view on or off&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands for Source Analysis''' - prefixed with &amp;quot;'''SA'''&amp;quot; (but see also ''MarkBlock'', which is used to send a block of data to SA and open the SA window):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| SAAddSource || add a dipole or regional source to a model&lt;br /&gt;
|-&lt;br /&gt;
| SAChannelTypeForFit || switch between EEG, magnetometers or axial gradiometers, and planar gradiometers&lt;br /&gt;
|-&lt;br /&gt;
| SAConvertSource || convert a source from dipole to regional source, or from regional source to dipole&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalClara || run Cortical CLARA&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalLoreta || run Cortical LORETA&lt;br /&gt;
|-&lt;br /&gt;
| SADelete || delete current solution or all solutions, or remove current fit interval or cursor&lt;br /&gt;
|-&lt;br /&gt;
| SADICS || start DICS computation (if DICS has been precomputed in the time-frequency image command)&lt;br /&gt;
|-&lt;br /&gt;
| SADisplayMRI || switch MRI display on/off and select small or large window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAElectrodeConfiguration&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || equivalent to pressing the Org or Std button in the Channel box of the Source analysis window&lt;br /&gt;
|-&lt;br /&gt;
| SAExit || close Source Module&lt;br /&gt;
|-&lt;br /&gt;
| SAFit || start fit&lt;br /&gt;
|-&lt;br /&gt;
| SAFitConstraint || set fit constraints, e.g. Residual Variance, Energy, Maximum Distance, Image Weighting, and their weights.&lt;br /&gt;
|-&lt;br /&gt;
| SAFitInterval || set fit or baseline interval&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAHeadModel&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the head model&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SALabelSource&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the label of the specified source number&lt;br /&gt;
|-&lt;br /&gt;
| SAMinimumNorm || run a minimum norm analysis&lt;br /&gt;
|-&lt;br /&gt;
| SANewSolution || open a new solution&lt;br /&gt;
|-&lt;br /&gt;
| SAOpenSolution || open a solution from a file&lt;br /&gt;
|-&lt;br /&gt;
| SAPCA || toggle PCA display of data or residual, and transfer a selected number of components to the source model&lt;br /&gt;
|-&lt;br /&gt;
| SARegularization || set the regularization values both for discrete and distributed source images&lt;br /&gt;
|-&lt;br /&gt;
| SASaveBitmap || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| SASaveLeadfields || save the leadfields of the current source model&lt;br /&gt;
|-&lt;br /&gt;
| SASaveModelWaveforms || save model waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveResidualWaveforms || save residual waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveRVandGFPWaveforms || save residual variance and global field power waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSolution || save the current solution&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceMontage || save a source montage&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceWaveforms || save source waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASendToMATLAB || send data, model, source waveforms, images, etc. to Matlab&lt;br /&gt;
|-&lt;br /&gt;
| SASetCursor || set the cursor&lt;br /&gt;
|-&lt;br /&gt;
| SASetDefaultSourceType || set the default source type (dipole or regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrActivateSource || Turn specified source on or off, or enable/disable source for fitting&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrientation || set orientation (of regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASwitchCondition || switch to a specified condition&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Distributed 3D Volume Images'''&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| SAIMAGEBeamformer || switch between Single Source and Bilateral Beamformer image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAIMAGEBeamformerTimeDomain&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start beamformer computation in the time domain&lt;br /&gt;
|-&lt;br /&gt;
| SAimageBrainAtlas || turns on the Brain Atlas overlay on volumetric image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGECLARA || generate CLARA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip image values under a threshold&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEExport || save the results of minimum norm or 3D imaging method&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEGotoMax || set the crosshair cursor at the nth maximum in the image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEImport || load a 3D volume image from file&lt;br /&gt;
|-&lt;br /&gt;
| SAimageImportFMRI || import fMRI image to Source Analysis Module&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELAURA || create LAURA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELORETA || create LORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESLoreta || create sLORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAimageSESAME || start SESAME computation&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESSLOFO || create SSLOFO image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEUser-Defined || create user-defined image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESaveLeadfields || save the leadfields of all the voxel sources in a 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESmooth || smooth current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESetCrosshair || set the position of the crosshair in the 3D image&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Time-Frequency Analysis''' ('''TFC''')&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| TFCStartTFAnalysis ||(previously TFCgo) start TFC analysis using the current paradigm settings&lt;br /&gt;
|-&lt;br /&gt;
| TFCdisplay || change the TFC display (e.g. power/amplitude, coherence)&lt;br /&gt;
|-&lt;br /&gt;
| TFCsave || save numerical results to an ASCII file, or save a screenshot of the TFC window&lt;br /&gt;
|-&lt;br /&gt;
| TFCimage || start beamformer analysis on a selected time-frequency range&lt;br /&gt;
|-&lt;br /&gt;
| TFCSendToMATLAB || send TF results or single-trial data to MATLAB&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How to Average Your Data in a Batch  ===&lt;br /&gt;
&lt;br /&gt;
Using batch processing, several files from an experiment can be averaged at a time.&lt;br /&gt;
&lt;br /&gt;
Here we summarize the steps required:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Create the paradigm, and save the paradigm file.&lt;br /&gt;
* Open each individual data file to check the data:&lt;br /&gt;
** Make sure auxiliary files are defined and loaded properly, and the data are displayed correctly.&lt;br /&gt;
** Eyeball the data.&lt;br /&gt;
** Define bad (and interpolated) channels.&lt;br /&gt;
** Mark artifact time ranges.&lt;br /&gt;
** If required, set up artifact correction for the file.&lt;br /&gt;
** The data file can be closed again after this step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Preparing the batch'''&lt;br /&gt;
&lt;br /&gt;
* Open at least one&amp;amp;nbsp;file and select ''Process / Batch Scripts''.... The file(s) should be displayed in the file list. Alternatively, just select ''Process / Batch Scripts...,'' and add the files by&lt;br /&gt;
** pressing the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** dragging the files from Windows Explorer&lt;br /&gt;
** Opening a previously saved&amp;amp;nbsp;list with ''Load File List''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* You can delete files from the list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt;) or edit the file sequence using the right click context menu.&lt;br /&gt;
* Select the ''Batch Tab''.&lt;br /&gt;
* Add commands to your script. For averaging, these would normally be&lt;br /&gt;
** '''Paradigm''' -- to load the paradigm file&lt;br /&gt;
** '''Artifact Scan''' -- to run the artifact scan&lt;br /&gt;
** '''Average''' -- to perform the average&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Save these commands (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Test the commands on the files in the current file list: press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Look at the log file (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;) to check the results of averaging.&lt;br /&gt;
* Look at the data averages to make sure they have been done correctly.&lt;br /&gt;
* Repeat these steps until averaging is working properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Select ''Process / Batch Scripts''....&lt;br /&gt;
* Open the files you want to average in the batch in the file list:&lt;br /&gt;
** Any files that were open in BESA are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Edit the file list, e.g. delete unwanted files (use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; key or the right click context menu), or reorder the files (use &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl + cursor keys'''&amp;lt;/span&amp;gt; or context menu).&lt;br /&gt;
* Note that the order of files in the list specifies the order in which they will be processed in the batch script. This order will be important if all results are saved to the same target file. Otherwise the file sequence is not important.&lt;br /&gt;
* Optionally, save the file list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Select the ''Batch Tab'', and load the previously defined batch script with ''Load Batch''.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch.&lt;br /&gt;
&lt;br /&gt;
=== How to Merge and Compress raw data  ===&lt;br /&gt;
&lt;br /&gt;
Using the Export command in a batch, several data files can be merged into a single data file in BESA's data format (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.foc&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This can be useful if data from one subject have been collected in several data blocks, and you want to analyze all data blocks together.&lt;br /&gt;
&lt;br /&gt;
Optionally, to save space, data can be saved in compressed format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Files can be merged:'''&lt;br /&gt;
&lt;br /&gt;
* if they have identical channel configurations, or&lt;br /&gt;
* there are at least 16 EEG channels, and the export format is Standard 81 (i.e. EEG channels are interpolated to 81 standard locations). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''How to merge files:'''&lt;br /&gt;
&lt;br /&gt;
* Select '''Process / Batch Scripts...'''&lt;br /&gt;
* Add all the files that are to be merged to the file list:&lt;br /&gt;
** Any files that were open in BESA Research are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list (''Load File List'').&lt;br /&gt;
* Rearrange the files in the file list to the sequence in which they should be merged.&lt;br /&gt;
* Select the ''Batch Tab ''and insert an &amp;quot;''Export&amp;quot;'' command, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following dialog shows a possible configuration of the ''Export'' command:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The parameters shown in the Information box are the settings chosen in the ''Export Dialog'' when the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt; button has been pressed.&lt;br /&gt;
* '''Append if file already exists''' must be checked in order to merge the files.&lt;br /&gt;
* The '''target file name''' must be fixed, i.e. don't use the '''%basename%''' variable, because that will result in a different target file name for each source file.&lt;br /&gt;
* There are two variables that can be used for the segment label:&lt;br /&gt;
** '''%filename%''' will insert the basename of the source file into the segment label.&lt;br /&gt;
** '''%c%''' will insert the file number into the segment label. The number gives&amp;amp;nbsp;the position of the file in the file list. For instance, &amp;quot;File %c%&amp;quot; will generate the label &amp;quot;File 2&amp;quot; for the second file in the list.&lt;br /&gt;
&lt;br /&gt;
=== Example: Data averaging in the auditory intensity experiment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, two raw data files, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;, from the auditory intensity experiment will be batch averaged.&lt;br /&gt;
&lt;br /&gt;
Please note that there are further tutorials covering this experiment. The first file is contaminated by many eyeblinks, and more epochs would be averaged if eye correction were used (see Viewlet demonstration on artifact correction on the BESA website). However, in this tutorial we will just use artifact rejection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Various ways of creating a File List'''&lt;br /&gt;
&lt;br /&gt;
1. '''Files that were open in BESA Research are automatically added to the File List.''' Start BESA Research and open the files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt '''&amp;lt;/span&amp;gt;in the directory ''Examples\ERP-Auditory-Intensity''.&lt;br /&gt;
&lt;br /&gt;
2. Select ''Process / Batch Scripts''.... You should see the file names in the '''''File List Tab''''' something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. You can resort the files in the file list alphabetically by clicking onto the '''''File List column header''''':&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can mark any file, hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;key and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrow '''&amp;lt;/span&amp;gt;to move the file name up or down the list. This is the sequence in which files will be processed in the batch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; and save the list you have created to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Highlight both names and press the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
6. '''Files can be dragged from Windows Explorer'''. Start Windows Explorer and navigate to the ''ERP-Auditory-Intensity'' subdirectory of your BESA Research examples folder (located in the ''Public Documents'' folder of your computer). Click on &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and drag it with the mouse onto the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''''File List Tab'''''. Let go of the mouse. BESA Research opens the file, and displays the name in the File List. Repeat for &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt.'''&lt;br /&gt;
&lt;br /&gt;
7. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
8. '''Files can be added using the ''Add File'' button'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; and navigate to the ''Examples\ERP-Auditory-Intensity'' subdirectory. Select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt;. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl'''&amp;lt;/span&amp;gt; and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;. Both names should then be displayed in the ''File Open'' dialog. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to add the files to the file list.&lt;br /&gt;
&lt;br /&gt;
9. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
10. '''Files can be loaded from a previously saved file list'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List '''&amp;lt;/span&amp;gt;and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;, the list you saved in step 6 above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Setting up the batch'''&lt;br /&gt;
&lt;br /&gt;
1. We will add three commands, '''Paradigm''', '''Artifact Scan''', and '''Average''', to create a batch that will be applied to the two files in the file list.&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''Batch Tab'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button to obtain the ''Select Command'' window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (9).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt; and then on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; (alternatively, double-click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt;). Hit &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Browse'''&amp;lt;/span&amp;gt;, navigate to the ''Auditory'' folder, and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''AEP_Intensity.pdg'''&amp;lt;/span&amp;gt;, the paradigm for the auditory intensity experiment.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (10).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to obtain the ''Load Paradigm Task'' window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (11).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;, and the first task in the batch is ready, and listed in the Batch Command window. If you want to modify the command, double-click on it to open the above window, that allows to browse for a different paradigm file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (12).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Next, we add the '''Artifact Scan''' command. Click on the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select ''Artifact Scan.''&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (13).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Artifact Scan Task'' window. We want to be able to view the results of the scan, and adjust thresholds and bad channels if necessary. Therefore, check the ''Wait after scan'' checkbox.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (14).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to close the ''Artifact Scan Task'' window. Our batch now contains two commands.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (15).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Finally, we will add an '''Average''' command. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button and select ''Average''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Average Task ''window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (16).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. With the default settings, the average would be saved to the same directory as the data. The file name mask is set by default so that in this example the two averages would be saved to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1-av.fsg '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2-av.fsg'''&amp;lt;/span&amp;gt;. We will save the averaged files to subdirectory ''&amp;quot;Averages''&amp;quot; of the data directory. Uncheck the ''Use default target'' check box, change the File name mask to '''%basename%_av-test''' in order not to overwrite the predefined files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (17).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Average Task'' window. Our batch is now complete.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (18).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
13. We will now save the batch so that it can be used again. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt; button, and save to the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-ex1.bbat'''&amp;lt;/span&amp;gt;. Note that an easy way to generate new averaging batches is to load a previously save batch and edit the commands -- it may only be necessary to edit the '''Paradigm''' command to select the relevant paradigm file, and maybe to adjust the target directory in the '''Average''' command.&lt;br /&gt;
&lt;br /&gt;
14. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch'' Window to start the batch running. As requested, the batch pauses after the artifact scan:. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (19).gif]]&lt;br /&gt;
&lt;br /&gt;
You may now adjust the number of rejected trials, e.g. by moving the vertical red bar to the left, or exclude bad channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to continue with averaging.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (20).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
16. Note that, in the background, the ''Batch Running'' window is providing feedback about the current file and current task.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
17. The batch will stop again after the next artifact scan. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to allow the batch to run to the end.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (21).gif|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
18. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log'''&amp;lt;/span&amp;gt; to view the batch protocol. If you are using Internet Explorer or Netscape family (Mozilla, Firefox) browsers, and JavaScript is enabled, you will first see just batch titles defined by the date and time the batch was started. The most recent title is at the top of the list. For other browsers, or if JavaScript was not enabled, all protocol texts are expanded as in 19 (below).&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (22).gif|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
19. Click on the first title to expand its protocol. Here, for example, the protocol gives feedback about the number of epochs that were averaged for each file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (23).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
20. Finally, press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to return to the main BESA Research display. Open the averages in the ''Averages'' subdirectory to confirm that they were generated properly.&lt;br /&gt;
&lt;br /&gt;
=== Example: Merging files using the Export Command ===&lt;br /&gt;
&lt;br /&gt;
Here we will demonstrate the use of the '''Export '''command to merge two files. We will combine the two averages from the previous example (Data averaging in the auditory intensity experiment) into one target file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Generate the file list'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and load the two data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av-test.fsg'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2_av-test.fsg'''&amp;lt;/span&amp;gt; that were saved in the previous example.&lt;br /&gt;
# Select ''Process / Batch Scripts....''The two file names should be displayed in the file list.&lt;br /&gt;
# In the file list, make sure that &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1_av-test.fsg '''&amp;lt;/span&amp;gt;is the first file in the list. If it is not, highlight the file, and move it up using &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl+up'''&amp;lt;/span&amp;gt;, or right click and select ''Move Up'' in the context menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Generate the batch'''&lt;br /&gt;
&lt;br /&gt;
1. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select the '''Export''' command.&lt;br /&gt;
&lt;br /&gt;
2. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Export Task'' window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (24).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt;... button to open the ''Export Dialog''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (25).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Since we are combining averages, select ''Hires (no compression)'' in the '''Target data format''' drop-down list (If we were merging raw data files, it is better to select compression. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the dialog. Check'' Append if file already exists'', so that the files will be merged. Enter '''s1+s2''' in the target file name mask edit box. This ensures that both files will be saved to the same target: &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (26).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Export Task'' window. The '''Export '''command is displayed. &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (27).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Optionally, you may save the batch file by pressing &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
7. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch, and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch Completed'' window to return to the BESA main window.&lt;br /&gt;
&lt;br /&gt;
8. Finally, open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt; to confirm that it contains the two merged files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Merge raw data'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Repeat the above task to merge the two raw data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2.cnt'''&amp;lt;/span&amp;gt; into a single target file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.foc'''&amp;lt;/span&amp;gt;. In this case, select one of the compression options as the target data format. Note that you would not normally want to merge two files from different subjects. However, several data blocks from the same subject can conveniently be merged using this method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; files can also be merged using the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''Combine Conditions''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; dialog. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions, Channels ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Combine Condition Scripts ===&lt;br /&gt;
&lt;br /&gt;
With the Combine-Conditions module you can do a variety of operations on BESA averages (files with the extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, and other segment files, such as &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.mul&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.swf&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* Create grand averages&lt;br /&gt;
* Combine averages (add, subtract, weighted/unweighted)&lt;br /&gt;
* Merge files&lt;br /&gt;
* Exclude unwanted averages&lt;br /&gt;
* Rename conditions&lt;br /&gt;
* Rename or resort channels&lt;br /&gt;
* Generate averages or differences over selected channels&lt;br /&gt;
* Transform the data: standard interpolated 81 electrodes, change sampling rate, change interval&lt;br /&gt;
* Determine peaks, mean amplitudes, or integrals on data averages&lt;br /&gt;
* These operations can be performed on one or more files simultaneously. Results of an operation are stored in a single target file.&lt;br /&gt;
&lt;br /&gt;
The module includes four tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* File List: Define a list of files on which the operations will be performed.&lt;br /&gt;
* Condition List: List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
* Channel List: List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
* Run Scripts: Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak analysis). Start the operation.&lt;br /&gt;
* Note that in all four tabs, configurations can be saved for future use, and the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button restores the most recently used configuration.&lt;br /&gt;
&lt;br /&gt;
=== Condition List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
&lt;br /&gt;
The first column of the&amp;amp;nbsp;list box shows a list of all the condition names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the source conditions. Columns define the target conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each condition name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target conditions will have the same name as source conditions. Right click on source condition labels to view properties (e.g. no. of samples, time range, sampling rate).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (28).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the condition list'''&lt;br /&gt;
&lt;br /&gt;
* Target condition names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: conditions can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over conditions, the sum is divided by the number of conditions, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;''Divide result by sum of PLUS factors''&amp;quot; is unchecked, the conditions will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between conditions, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the condition list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Weighting of averages'''&lt;br /&gt;
&lt;br /&gt;
* Below the list, click on the ''Weighted Average'' row to toggle &amp;quot;YES&amp;quot; and &amp;quot;NO&amp;quot;. &amp;quot;YES&amp;quot; means that averages will be weighted by the number of epochs contributing to the average. For instance, if average A contained 100 epochs and average B contained 200 epochs, the weighted average will be computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(100 * A + &amp;amp;nbsp;200 * B) / (100 + 200)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Select &amp;quot;NO&amp;quot; for an unweighted average. For the above example, the average is computed as&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(A + B) / 2&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Weighted averages are not permitted if one of the boxes contains a negative value.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Values other than +1 or -1 in the boxes apply a different kind of weighting. For instance, we want to compute the difference between the means of conditions A, B, C and D, E. Use a right click to specify the fraction 1/3 for each of A, B, and C, and -1/2 for each of D and E (see example below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (29).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Feedback'''&lt;br /&gt;
&lt;br /&gt;
* Conditions that have different numbers of electrodes (averaging across different files) can only be combined if channels are interpolated to a standard set of electrodes.&lt;br /&gt;
* Conditions that have different durations or sampling rates can only be combined if the sampling rate and durations are made the same.&lt;br /&gt;
* Feedback about the above situations is displayed by the presence of tick marks above the list box.&lt;br /&gt;
&lt;br /&gt;
=== Channel List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
&lt;br /&gt;
Note that this tab is very similar in usage to the '''Condition List Tab'''. Note also that some of the functions performed in this tab could also be done in the Montage Editor. It may be a matter of convenience whether you choose to perform these operations here or in the Montage Editor.&lt;br /&gt;
&lt;br /&gt;
The first column of the list box shows a list of all the channel names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the ''source'' channel. Columns define the'' target'' channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each channel name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target channel will have the same name as source channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Combining files'''&lt;br /&gt;
&lt;br /&gt;
If files with different channel configurations are included in the File List, the rows and columns of the Channel List Tab will only contain the labels for the channels that are in common among the files.&lt;br /&gt;
&lt;br /&gt;
If the files in the File List have a different sequence of channels, the sequence of the first file in the list will be adopted in the Channel List.&lt;br /&gt;
&lt;br /&gt;
Thus, for the initial setting, unless the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked, the target grand average or peak/amplitude analysis, etc. will be applied using only channels that are in common among the input files, and using the channel sequence of the first file in the File List. By changing the target channels or by changing the entries in the Channel List, new channels consisting of averages or differences can be generated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''What can the Channel List be used for?'''&lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
&lt;br /&gt;
* Reorder or relabel channels&lt;br /&gt;
* Create channel differences&lt;br /&gt;
* Create averages over channel groups, e.g. for peak analysis&lt;br /&gt;
* Extract a selection of channels for peak analysis or mean amplitudes&lt;br /&gt;
* Create grand averages across files with different channel configurations, just using channels in common among the files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (30).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the channel list'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Target channel names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: channels can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over channels, the sum is divided by the number of channels, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;Divide result by sum of PLUS factors&amp;quot; is unchecked, the channels will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between channels, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the channel list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Channel List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Channel List&amp;amp;nbsp;'''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
=== Run Scripts Tab ===&lt;br /&gt;
&lt;br /&gt;
Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak detection. Start the operation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load or Save Settings'''&lt;br /&gt;
&lt;br /&gt;
* You can save the current settings of this tab to a file (*.run) which can be loaded later.&lt;br /&gt;
* When you run the script, the current settings are saved automatically to a file &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* Press this button to load the previous settings (from &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Averages to Generate'''&lt;br /&gt;
&lt;br /&gt;
* '''Generate separate averages for each source file'''. Averages are performed over conditions within the source file, and are then appended to the target file.&lt;br /&gt;
* '''Combine data from source files'''. Conditions are combined over all source files into a single target average.&lt;br /&gt;
* '''No averages, just copy'''. Files are copied and merged to the target file. Use this option for renaming conditions, merging files, removing unwanted averages (see below), changing the sampling rate and interval.&lt;br /&gt;
* '''Peaks and mean amplitudes'''. Specify time ranges for peaks, mean amplitudes, or integrals (areas).&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note: When generating or copying averages (first three options), filters and baseline settings are turned off. For Peaks and mean amplitudes, filters and baseline settings are specified in the dialog.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Spatial Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Interpolate to Standard 81 electrodes'''. The target file will contain only electrodes (other channels are omitted), using the Standard 81 configuration (as in other export functions within BESA Research). This cannot be selected if the source data contain less than 16 EEG channels.&lt;br /&gt;
* '''Interpolate Bad Channels'''. Bad electrode channels in the source file will be interpolated. If the above option is deselected and bad channels exist in one or more of the source files, this option is always on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;BESA Research can interpolate EEG, and MEG if the sensors are axial gradiometers or magnetometers. If other channels are marked as bad in one or more of the source files, these will be defined as bad in the target file. This applies to MEG planar gradiometers, to polygraphic data, and to ICR channels.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Temporal Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Spline to New Sampling Rate and Interval'''. Data can be converted to a new sampling rate, and the interval can be changed.&lt;br /&gt;
** If the sampling rate is reduced, the data will be low-pass filtered at 1/3 sampling frequency before reduction.&lt;br /&gt;
** If the sampling interval is changed, the prestimulus and poststimulus intervals are limited by the smallest intervals in the conditions contributing to the averages. These limits are shown below the edit boxes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks and Mean Amplitudes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (31).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range between which peaks are to be determined.&lt;br /&gt;
* Select the montage on which the peaks are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Define the baseline settings.&lt;br /&gt;
* Specify whether peaks are to be defined at one latency: if so, select the channel on which peaks are to be detected.&lt;br /&gt;
* Specify whether you want to find positive or negative peaks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Mean amplitudes and areas:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range over which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Select the montage on which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Note that when computing areas, data are first rectified (made positive) and then summed over the time range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Output options of the analysis:'''&lt;br /&gt;
&lt;br /&gt;
* A single ASCII file that contains the result of the analysis for all data sets, conditions, and channels including header and information lines.&lt;br /&gt;
* A sparse output suitable for import in SPSS. Each variable (e.g. a latency, a channel amplitude) constitutes one column of the output file.&lt;br /&gt;
* Direct transfer to MATLAB into a struct besa_peak. For more information on the data transfer from BESA Research to MATLAB, please refer to help chapter ''“The MATLAB interface”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Starting the Operation'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;to start the operation. After the operation is completed, and the &amp;quot;Open target file in BESA&amp;quot; box is checked, BESA Research will open the target file. &amp;amp;nbsp;&amp;quot;Open target file in BESA&amp;quot; cannot be checked if &amp;quot;Peaks and mean amplitudes&amp;quot; was selected - then the result of the operation will be an ASCII file or a MATLAB transfer.&lt;br /&gt;
* You will be asked for the name of the target file (unless a MATLAB transfer of peak data has been performed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Restrictions'''&lt;br /&gt;
&lt;br /&gt;
* Depending on source file configurations, not all options above are selectable. For instance, if two files contain different numbers of electrodes, and the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked in the '''''Channel List''''' Tab, spatial interpolation to Standard 81 is enforced in the target. Similarly, if different sampling rates are used in different files, temporal interpolation is enforced.&lt;br /&gt;
* You are not allowed to add files to the file list if the channel configuration is different, and the data cannot be combined with Standard 81 interpolation. Since Standard 81 interpolation is only possible for EEG, multiple files without EEG can only be loaded if they have the same number of channels.&lt;br /&gt;
&lt;br /&gt;
=== How to Create Grand Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to average in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To average across different conditions, click in the list boxes to obtain &amp;quot;+1&amp;quot; for each source condition to combine, and rename the target condition to define a meaningful name for the average.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Generate Differences Between Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To create differences, click in the list boxes to obtain &amp;quot;+1&amp;quot; for one of the source conditions, and &amp;quot;-1&amp;quot; for the source condition to subtract, and rename the target condition to define a meaningful name for the difference.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. An average of the differences is generated. If only one example of each condition exists, e.g. in a grand average file, the result is the difference between conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Merge Files ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to merge in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notes'''&lt;br /&gt;
&lt;br /&gt;
* If the source files have different electrode configurations, use the Standard 81 configuration for the target.&lt;br /&gt;
* If the source files have different sampling rates or intervals, use Temporal Interpolation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Remove Unwanted Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted segments'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as averages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted conditions (by label)'''&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Deselect the target conditions you want to omit (replace the &amp;quot;+1&amp;quot; by a blank).&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as artifacts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Rename Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. Click on column headings to rename the target conditions.&lt;br /&gt;
* Click on the''' Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data with the renamed conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Change the Sampling Rate ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file(s) you want to change in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...'').&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Select &amp;quot;''Spline to New Sampling Rate and Interval''&amp;quot; and type the new sampling rate into the edit box.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Create grand average and combinations of conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, we will generate a grand average of the results of the Auditory Intensity Experiment. The experiment includes averages from five different stimulus intensities. We will create a grand average over each intensity, but also include means over the two lowest and the two highest intensities, and the difference between these two combinations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av.fsg - S10_av.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The files contain the individual averaged data of the 10 subjects who participated in this study.&lt;br /&gt;
# Select ''ERP / Combine Conditions...'' The file list should display the two files, with feedback about the number of averages and conditions. 8 epochs are found. See the ''“Data averaging in the auditory intensity'' ''experiment”'' example for examples how to manipulate the file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (32).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. The initial window defines target conditions with the same name as the source conditions. To generate the grand average over these conditions we could proceed without further changes to the '''Run Scripts Tab'''. However, we want to modify the condition list and create a condition that contains the grand averaged difference between the''' High''' and '''Low''' conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''All '''column label. In the resulting window, rename condition '''All''' to''' Difference'''. Then press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (33).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. The last column is now labeled '''Difference.''' Left-click twice onto the ‘'''+1’''' entry that links this condition to the '''All '''input condition. This will remove the link and leave the field blank. To define the ‘Difference’ condition as the average of ‘High’ minus ‘Low’ over subjects, left-click once into the field linking input '''High''' with target '''Difference''' to generate an entry ‘'''+1’''' in this field. Left-click twice into the field linking input '''Low '''with target '''Difference''' to generate an entry '-'''1'''’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;[[Image:Batch processing (35).gif]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; and save the list to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ER&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;P-aud-ex1.clist'''&amp;lt;/span&amp;gt;. This condition combination can thus be loaded later using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Click on the '''Run Script Tab'''.&lt;br /&gt;
# The default tab settings are ready for generating the grand average ('''Combine data from source file''' and '''Open target file in BESA''' should be checked). Just press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Enter &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_cc-test.fsg'''&amp;lt;/span&amp;gt; as file name and press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Save'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The resulting file contains the 8 target conditions, 60db, 70dB, 80dB, 90dB, 100dB, Low, High, and Difference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Average files from different experiments ===&lt;br /&gt;
&lt;br /&gt;
This example is intended to illustrate several features of the ''Combine Conditions'' Dialog, such as electrode interpolation and resampling. We will combine an average from the Auditory Intensity experiment with one from the P300 auditory experiment. In this particular case, it is not a very meaningful thing to do, but it shows what is possible. For instance, the same experiment may have been performed using different sampling rates or electrode combinations. This example shows how such data may be combined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_GA.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The file contains the grand average data from the auditory intensity experiment.&lt;br /&gt;
# Open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''RareFrequentResponseLeft.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-P300-Auditory'' folder. This file contains averages from the P300 auditory experiment.&lt;br /&gt;
# Select ''ERP / Combine Conditions... ''Note that the files have different sampling rates and different numbers of electrodes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (36).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. Note that the feedback text at the bottom of the window displays the text &amp;quot;Standard 81 interpolation required to generate average; Across files: resampling or change in time range required to generate average&amp;quot;. The condition labels show all the names from both files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (37).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.  We will exclude most conditions, and just combine the most similar conditions from the two experiments: the &amp;quot;Standard&amp;quot; and the &amp;quot;80dB&amp;quot; conditions. Click on the title of the first column,''' Blink'''. Select “''Delete all conditions to the right of this column”'', and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (38).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on the title again, and rename the target condition to &amp;quot;Standard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (39).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click twice in the first line to remove the &amp;quot;+1&amp;quot; entry there. Click once in the third row (&amp;quot;Frequent&amp;quot;), and in the 7th row (&amp;quot;80dB&amp;quot;), to display &amp;quot;+1&amp;quot; at each entry. Thus, just two of the conditions will be combined into one target condition.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (40).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Run Script Tab'''. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (41).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Note that '''Interpolate to Standard 81 electrodes''' is checked and grayed: since two different electrode sets are to be combined, we can only do this by interpolating electrodes. Also, both '''Spline to new sampling rate''' and '''Clip interval '''are checked and grayed. Again, these settings are required in order to be able to average the two data files together. The sampling rate is set to the higher of the two selections. The time range is set to the largest possible range that can be clipped from the two data sets. For now, leave these settings as they are, and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Save the target to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''TestCombineExpts_CC-std81.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing</id>
		<title>BESA Research Batch Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing"/>
				<updated>2021-05-05T07:44:31Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: Reverted edits by Abinash (talk) to last revision by Mateusz&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==  Batch Processing and Combining Conditions == --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions and Batch Module: Introduction ==&lt;br /&gt;
&lt;br /&gt;
Functions of this module are started by selecting the menu operations &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Combine Conditions...'''&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Batch Scripts...'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''Combine Condition Scripts''' provides various operations on BESA averages.&lt;br /&gt;
* '''Batch Scripts''' provides batch operations on all data files.&lt;br /&gt;
* Note that a batch script can also be performed on the current file by selecting &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Run Batch...'''&amp;lt;/span&amp;gt;&amp;quot; or by typing the shortcut key &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''R'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== File List Tab ==&lt;br /&gt;
&lt;br /&gt;
Define a list of files on which the operations will be performed. The tab is the same for Combine Conditions Scripts and for Batch Scripts. Combine Conditions Scripts only allows you to open BESA average files (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, but also &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.raw'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.swf'''&amp;lt;/span&amp;gt;, and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt; if the files have a defined pre-stimulus interval), whereas Batch Scripts allows you to open any data file whose format is known to BESA Research.&lt;br /&gt;
&lt;br /&gt;
When the Combine-Conditions or the Batch module is started, all currently opened (Combine-Conditions: averages only) files are displayed in the list.&lt;br /&gt;
&lt;br /&gt;
To the right of each file name, the number of electrodes, total number of channels, and the sampling rate used in the file are displayed. In the Combine-Conditions module, the number of Epochs (segments) and the number of differently-named conditions are also shown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add files to the list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File '''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
* Drag one or more files from Windows Explorer onto the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Remove files from the list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and confirm the delete operation in the resulting dialog.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key to mark multiple files). Right click to obtain the context menu and select &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;quot;, or just press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Reorder files within the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctr'''&amp;lt;/span&amp;gt;l key to mark multiple files). Right click to obtain the context menu and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;, or hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key '''and '''press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrows'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sort the current file list alphabetically'''&lt;br /&gt;
&lt;br /&gt;
* Click on the File bar above the list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List'''&amp;lt;/span&amp;gt; button, or the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button to load the most recently used file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Which conditions are read from a source file? (Combine-Conditions module only)'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File list from Combine Conditions:'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (1).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Don't try to open here... (Batch only)'''&lt;br /&gt;
&lt;br /&gt;
By default, this checkbox is unchecked.&lt;br /&gt;
&lt;br /&gt;
In the checked state, BESA Research doesn't check if it can open the file. Use this function '''only''' if the file is ASCII and you want to use the '''ImportASCII '''batch command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File List from Batch Scripts''':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (2).png]]&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Batch Processing &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== Batch Processing Scripts ===&lt;br /&gt;
&lt;br /&gt;
With Batch Scripts, you can define a set of operations (e.g. Artifact Scan, Average, etc.) and apply these to several data files.&lt;br /&gt;
&lt;br /&gt;
These operations include&lt;br /&gt;
&lt;br /&gt;
* Load Paradigm&lt;br /&gt;
* Artifact Scan&lt;br /&gt;
* Average&lt;br /&gt;
* Export (and Merge)&lt;br /&gt;
* File Open (switch to another data file)&lt;br /&gt;
* Set filters&lt;br /&gt;
* Specify a montage (used, for example, for export to current montage)&lt;br /&gt;
* Run automatic eye and EKG artifact correction&lt;br /&gt;
* Define artifact topographies&lt;br /&gt;
* Turn artifact correction and view on and off&lt;br /&gt;
* Read and write events&lt;br /&gt;
* Edit default block epoch (for export around triggers)&lt;br /&gt;
* Edit triggers (for export around triggers)&lt;br /&gt;
* Mark a block for export, or send the block to Source Analysis or Top View&lt;br /&gt;
* Convert patterns to triggers&lt;br /&gt;
* Attach auxiliary files (e.g. elp, sfp) to the data file&lt;br /&gt;
* Send to MATLAB&lt;br /&gt;
* Specify display configurations for the BESA Research Main, SA, and Top View windows&lt;br /&gt;
* and more - see the full list of [[Batch Commands]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An additional set of commands are available for operations in the '''Source Analysis Module''', allowing to load, create and fit dipole models, and save the results.&lt;br /&gt;
&lt;br /&gt;
A further set of commands apply to '''Time-Frequency Analysis''', allowing to start TFC, change the display, save results, and run the beamformer or DICS analyses on a selected time-frequency range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
These operations will be extended in future program releases.&lt;br /&gt;
&lt;br /&gt;
The module includes two tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* '''File List''': Define a list of files on which the operations will be performed.&lt;br /&gt;
* '''Batch''': Define or load '''batch commands'''. Run the batch.&lt;br /&gt;
&lt;br /&gt;
=== Batch Tab ===&lt;br /&gt;
&lt;br /&gt;
Load or define batch commands, and then apply them to the files in the File List.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add Command'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; to add a new command to the batch. The following dialog is opened, showing the available commands:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch commands1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Select the desired command and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; or double-click on the command. A dialog box is opened, allowing to specify individual command parameters.&lt;br /&gt;
* If you click on &amp;quot;Apply at beginning of batch&amp;quot; or &amp;quot;Apply at end of batch&amp;quot;, the command will only be run at the beginning or the end of a batch. You can use this, for example, at the end of a batch to start a MATLAB script to perform statistics on the results of the batch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load and Save Batch'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load a previously defined batch or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to save the current batch to a file (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.bbat&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load the most recently used batch file. Whenever a batch is run, the current set of commands is written to the file &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Previous.bbat in'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Scripts/Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; subdirectory. This file is loaded when you press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Clear All'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Clears all commands from the window.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''View Log File'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Each time a batch is run, BESA Research adds information about the batch to a log file, with headings showing the date and time the batch was started. The file is opened automatically in Internet Explorer if errors occurred during processing. Otherwise you may open the file by &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button here or in the dialog that is displayed at the end of batch processing. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The log file is saved in xml format, and a JavaScript is used to format the display in web browsers. JavaScript should be enabled in the browser to obtain an optimal display of the results. If JavaScript is enabled, the log file is displayed as a list of headings for each batch. Click on a heading to display the results of the corresponding batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;To open the log file in the Notepad, hold the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Shift '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;key down when pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Batch Command List'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Double-click on a command to edit it. See &amp;lt;/span&amp;gt;[[Batch Commands]]&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for descriptions of the dialogs that are opened to edit each command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Right click on a command to open a context menu allowing more options.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Move Up'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''and Move Down'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; can also be applied to multiple selections.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If you have made a multiple selection, the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button will delete all the marked commands. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;plus &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''cursor keys'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will move the marked commands up or down.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Comment'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove a semicolon (;) in front of the command, to deactivate or reactivate the command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Command Only at Start/End'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove the text &amp;quot;Start_&amp;quot; or &amp;quot;End_&amp;quot; in front of the command. With these prefixes, the command will only be performed when the first file (&amp;quot;Start_&amp;quot;) or the last file (&amp;quot;End_&amp;quot;) in the file list is being processed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Single Step Mode'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Check this item to step through the batch, one command at a time. A dialog is opened after each command, allowing to run the next command, continue the batch without single steps, or stop running the batch. See the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'' “Pause''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;” command for further details.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;During a batch, press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changes in batch written to database'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Checked by default. If this item is unchecked, file display settings, such as Montage setting and Artifact correction display, are not written to the database. When the file is next opened in BESA Research, the settings made in the batch are not retained.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Leave files in the file list open after running the batch'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If this item is checked, files in the file list will remain open after the batch. This is useful, for instance, if you want to open a set of files, specifying the same montage and/or filter settings for each file.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to start running the batch. Each command is then applied in succession to each file in the File List.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that, while a batch is running press and hold down the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The log file ===&lt;br /&gt;
&lt;br /&gt;
A protocol of each batch is written to the log file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Scripts/Log/Batch.xml.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File '''&amp;lt;/span&amp;gt;button, the file is opened in your default browser for xml files. The file will be opened automatically if there was an error during batch processing, unless you have used the ''BatchError'' batch command to suppress this behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''DHTML formatting of the log file'''&lt;br /&gt;
&lt;br /&gt;
The xml file is formatted using JavaScript (Dynamic HTML). If JavaScript is enabled in your browser, you will first see a list of batch protocol titles, labeled by the date and time at which the batch was started. The most recent batch is at the top of the list.:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).png|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the title to view the protocol for the corresponding batch:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''JavaScript and XP Service Pack 2'''&lt;br /&gt;
&lt;br /&gt;
By default, if the log file is opened in Internet Explorer after XP Service Pack 2 has been installed, IE will warn you with the message: &amp;quot;''To help protect your security, Internet Explorer has restricted this file from'' ''showing active content that could access your computer&amp;quot;.'' All the protocols in the log file are displayed. You may safely click on the options to allow active content in the log file, if you want to display the file as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Backup of the log file'''&lt;br /&gt;
&lt;br /&gt;
When the log file is written, a backup of the previous version is written to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml.bak'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the size of the log file exceeds 200 KB, it is renamed to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml_date_time'''&amp;lt;/span&amp;gt; (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.xml_2004-10-08_10-53-32'''&amp;lt;/span&amp;gt;), and a new version of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml'''&amp;lt;/span&amp;gt; is created.&lt;br /&gt;
&lt;br /&gt;
=== Placeholders ===&lt;br /&gt;
&lt;br /&gt;
A powerful feature of the batch commands is the ability to define file names and specify standard paths using placeholders. These are text strings enclosed by percentage (%) signs. They can be used in all batch commands where file names are specified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Basename'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Placeholder !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; width=&amp;quot;10%&amp;quot;|'''%basename%'''&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|replaced by the basename of the currently opened file.&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%basename-n%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the last &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%-nbasename%'''&lt;br /&gt;
|replaced by the basename of the currently opened file, but removing the first &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasename%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list (it has the same meaning as %basename% if no MAINFileOpen batch command was used in command list)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%base%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file without the path&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbase%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by basename of the current file in the file list without the path&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%ext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgext%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by extension of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%basefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%orgbasefolder%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|replace by folder of the current file in the file list&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%t%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: time since start of batch on current file&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%T%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Log batch command only: current date and time&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%label%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|Replace label of the most recent marked block by the block label, not including no. of averages&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|&amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;'''%LABEL%'''&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
| Replace label of the most recent marked block by the block label, including no. of averages&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%scripts%'''&lt;br /&gt;
|replaced by the path to the Scripts folder.&lt;br /&gt;
|&amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard MATLAB scripts used by BESA Research.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%montages%'''&lt;br /&gt;
|replaced by the path to the Montages folder.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%examples%'''&lt;br /&gt;
|replaced by the path to the Examples folder.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''%basename%''' -- replaced by the basename of the data file in the File List. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''%basename-n%''' -- replaced by the basename of the data file in the File List, but removing the last &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%-nbasename%''' -- replaced by the basename of the data file in the File List, but removing the first &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%scripts%''' -- replaced by the path to the Scripts folder (e,g, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard Matlab scripts used by BESA Research).&lt;br /&gt;
&lt;br /&gt;
* '''%montages%''' -- replaced by the path to the Montages folder.&lt;br /&gt;
&lt;br /&gt;
* '''%examples%''' -- replaced by the path to the Examples folder.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Placeholders for folders'''&lt;br /&gt;
&lt;br /&gt;
The following placeholders are the same as those used in the [Folders] section of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Besa.ini'''&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The strings enclosed by percent signs (%) are placeholders for the following folders in English-language versions of Windows. Folder names are different for the system and for other language settings. BESA Research will substitute the placeholders by the appropriate folder name for the Windows system and the system language:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 10 (English)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%localapp%''' = &amp;quot;&amp;quot;C:\Users[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;&amp;quot;Desktop[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%publicprog%''' = &amp;quot;Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;&amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Desktop\[User]\Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir%'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 7 (English):'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%localapp%''' = &amp;quot;C:\Users\[user]\AppData\Local\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;Desktop\[user]\AppData\Local\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%publicprog%''' = &amp;quot;C:\Users\Public\Public Documents\BESA\Research_7_1&amp;quot;. This folder is directly accessible from the Windows Explorer under &amp;quot;Libraries\Documents\Public Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;C:\Users\[user]\Documents\BESA\Research_7_1&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;&amp;quot;Libraries\Documents\My Documents\Research_7_1&amp;quot; or &amp;quot;Desktop\[User]\My Documents\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_7_1&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir% &amp;amp;nbsp;'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Batch Commands ===&lt;br /&gt;
&lt;br /&gt;
Batch commands are selected when the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt;&amp;quot; button is pressed in the &amp;quot;Batch&amp;quot; Tab. The commands are subdivided into five categories: General commands, commands for the Main module, for the Source Analysis module, imaging commands in the Source Analysis module, and commands for Time-Frequency Analysis. The commands have prefixes,''' GEN''', '''MAIN''',''' SA''', '''SAIMAGE''', and''' TFC'''), which identify the category. For compatibility with older program versions, old batches without the prefixes are accepted.&lt;br /&gt;
&lt;br /&gt;
Detailed descriptions of each batch command are available in the electronic help chapter “''Batch Processing and Combining Conditions / Batch Processing / Batch Commands”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands''' - prefixed with &amp;quot;'''GEN'''&amp;quot; (can be used anywhere):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| GENBatchError || used to change program behavior when errors occur&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENBatchWindowPosition&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the position of the batch window relative to the main window&lt;br /&gt;
|-&lt;br /&gt;
| GENComment || comment in the batch script: no batch functionality&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABcommand || send a command string to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| GENMATLABwaitForVariable || tells BESA to wait until Matlab has created a variable with the specified name.&lt;br /&gt;
|-&lt;br /&gt;
| GENPause || pause batch operations, allowing step-by-step operations&lt;br /&gt;
|-&lt;br /&gt;
| GENFor/GENEndFor|| a programming language-like FOR loop&lt;br /&gt;
|-&lt;br /&gt;
| GENRunProcess || runs a command line process, e.g. an external program to perform part of the data analysis in the batch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;GENsaveBitmap&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SetVariable&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the value of the variable is inserted into subsequent batch commands where the text contains the name flanked by % signs&lt;br /&gt;
|-&lt;br /&gt;
| GENWindowPosition || set window size and positions to a selection of standard settings, e.g. for bitmap export&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for the Main Module''' - prefixed with &amp;quot;'''MAIN'''&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| MAINArtifactCorrect || run automatic artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactMethod || specify the method for artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactOn || turn artifact correction an artifact view on or off&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifact Scan || run an artifact scan as from the Paradigm Dialog&lt;br /&gt;
|-&lt;br /&gt;
| MAINAuxiliaryFiles || associate auxiliary files (e.g. *.''ela'', *.''sfp'') with the data file&lt;br /&gt;
|-&lt;br /&gt;
| MAINAverage || average the data&lt;br /&gt;
|-&lt;br /&gt;
| MAINBaseline || specify the parameters for baseline correction&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINDefineArtifactTopography&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || define an artifact topography&lt;br /&gt;
|-&lt;br /&gt;
| MAINEditDefaultEpoch || edit the default block epoch&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventRead || read events from an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventWrite || write events to an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINExport || export or append data in the selected target format&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINExportToBESAConnectivity&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || export data segments to BESA Connectivity&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFT || calculates the FFT spectrum of the marked data interval&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTmean || starts an averaging procedure which calculates the mean spectral properties in pre-defined regions&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTsave || saves FFT data (generated using the ''FFT Average option'' in the ''Average ''command) to disk (*.''fma)''&lt;br /&gt;
|-&lt;br /&gt;
| MAINFileOpen || close the current file and open a new file to which the remaining batch commands will be applied&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINFileClose&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || close the currently open file in a batch, provided it is not the current file in the File List&lt;br /&gt;
|-&lt;br /&gt;
| MAINFilter || set filters&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINfMRIArtifact&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns on the fMRI artifact removal&lt;br /&gt;
|-&lt;br /&gt;
| MAINGoTo || jumps with the cursor to the specified time point&lt;br /&gt;
|-&lt;br /&gt;
| MAINICA || starts ICA decomposition of data on the current screen &lt;br /&gt;
|-&lt;br /&gt;
| MAINICAsave || saves selected ICA components as topographies in a file&lt;br /&gt;
|-&lt;br /&gt;
| MAINICAselect || opens component selection dialog for managing ICA components&lt;br /&gt;
|-&lt;br /&gt;
| MAINImportASCII || import an ASCII file into a ''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'' file.&lt;br /&gt;
|-&lt;br /&gt;
| MAINMarkBlock || mark a data block (optionally send to Source Analysis)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMarkChannels&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || mark one or more channels, as given by the list&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINMaxInInterval&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || within the current marked block, search for the largest absolute value on the specified channel&lt;br /&gt;
|- &lt;br /&gt;
| MAINMontage || change the montage (used by the Export command when saving to current montage)&lt;br /&gt;
|-&lt;br /&gt;
| MAINParadigm || load a paradigm file&lt;br /&gt;
|-&lt;br /&gt;
| MAINPatternToTrigger || convert a tag into a trigger&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINPolygraphicFilters&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || sets filters for polygraphic or added channels&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINScale&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set amplitude and time scales&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSearchAverageView&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start search average view&lt;br /&gt;
|-&lt;br /&gt;
| MAINSendToMATLAB || send data to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINSplineConstant&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the spline constant used in spherical spline maps and channel interpolation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerRecode&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || the command recodes a specified trigger number to a new number&lt;br /&gt;
|-&lt;br /&gt;
| MAINTriggerSelect || edit the trigger list (cf. ''Edit / Trigger Values''...)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINTriggerTagDelete&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || delete one or more triggers or tags&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewAverageBuffer&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turn on the Average Buffer View and place the specified buffer number to the left in the display&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewChannelType&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || select the channel type to display, and select channel types for mapping, export, etc&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;MAINViewSelected&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || turns selected view on or off&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands for Source Analysis''' - prefixed with &amp;quot;'''SA'''&amp;quot; (but see also ''MarkBlock'', which is used to send a block of data to SA and open the SA window):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| SAAddSource || add a dipole or regional source to a model&lt;br /&gt;
|-&lt;br /&gt;
| SAChannelTypeForFit || switch between EEG, magnetometers or axial gradiometers, and planar gradiometers&lt;br /&gt;
|-&lt;br /&gt;
| SAConvertSource || convert a source from dipole to regional source, or from regional source to dipole&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalClara || run Cortical CLARA&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalLoreta || run Cortical LORETA&lt;br /&gt;
|-&lt;br /&gt;
| SADelete || delete current solution or all solutions, or remove current fit interval or cursor&lt;br /&gt;
|-&lt;br /&gt;
| SADICS || start DICS computation (if DICS has been precomputed in the time-frequency image command)&lt;br /&gt;
|-&lt;br /&gt;
| SADisplayMRI || switch MRI display on/off and select small or large window&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.0 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAElectrodeConfiguration&amp;lt;/&amp;gt;&amp;lt;/span&amp;gt; || equivalent to pressing the Org or Std button in the Channel box of the Source analysis window&lt;br /&gt;
|-&lt;br /&gt;
| SAExit || close Source Module&lt;br /&gt;
|-&lt;br /&gt;
| SAFit || start fit&lt;br /&gt;
|-&lt;br /&gt;
| SAFitConstraint || set fit constraints, e.g. Residual Variance, Energy, Maximum Distance, Image Weighting, and their weights.&lt;br /&gt;
|-&lt;br /&gt;
| SAFitInterval || set fit or baseline interval&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAHeadModel&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the head model&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SALabelSource&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || set the label of the specified source number&lt;br /&gt;
|-&lt;br /&gt;
| SAMinimumNorm || run a minimum norm analysis&lt;br /&gt;
|-&lt;br /&gt;
| SANewSolution || open a new solution&lt;br /&gt;
|-&lt;br /&gt;
| SAOpenSolution || open a solution from a file&lt;br /&gt;
|-&lt;br /&gt;
| SAPCA || toggle PCA display of data or residual, and transfer a selected number of components to the source model&lt;br /&gt;
|-&lt;br /&gt;
| SARegularization || set the regularization values both for discrete and distributed source images&lt;br /&gt;
|-&lt;br /&gt;
| SASaveBitmap || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| SASaveLeadfields || save the leadfields of the current source model&lt;br /&gt;
|-&lt;br /&gt;
| SASaveModelWaveforms || save model waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveResidualWaveforms || save residual waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveRVandGFPWaveforms || save residual variance and global field power waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSolution || save the current solution&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceMontage || save a source montage&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceWaveforms || save source waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASendToMATLAB || send data, model, source waveforms, images, etc. to Matlab&lt;br /&gt;
|-&lt;br /&gt;
| SASetCursor || set the cursor&lt;br /&gt;
|-&lt;br /&gt;
| SASetDefaultSourceType || set the default source type (dipole or regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrActivateSource || Turn specified source on or off, or enable/disable source for fitting&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrientation || set orientation (of regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASwitchCondition || switch to a specified condition&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Distributed 3D Volume Images'''&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| SAIMAGEBeamformer || switch between Single Source and Bilateral Beamformer image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span title=&amp;quot;Requires BESA Research 7.1 or higher&amp;quot;&amp;gt;&amp;lt;u&amp;gt;SAIMAGEBeamformerTimeDomain&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt; || start beamformer computation in the time domain&lt;br /&gt;
|-&lt;br /&gt;
| SAimageBrainAtlas || turns on the Brain Atlas overlay on volumetric image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGECLARA || generate CLARA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip image values under a threshold&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEExport || save the results of minimum norm or 3D imaging method&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEGotoMax || set the crosshair cursor at the nth maximum in the image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEImport || load a 3D volume image from file&lt;br /&gt;
|-&lt;br /&gt;
| SAimageImportFMRI || import fMRI image to Source Analysis Module&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELAURA || create LAURA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELORETA || create LORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESLoreta || create sLORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAimageSESAME || start SESAME computation&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESSLOFO || create SSLOFO image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEUser-Defined || create user-defined image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESaveLeadfields || save the leadfields of all the voxel sources in a 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESmooth || smooth current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESetCrosshair || set the position of the crosshair in the 3D image&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Time-Frequency Analysis''' ('''TFC''')&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| TFCStartTFAnalysis ||(previously TFCgo) start TFC analysis using the current paradigm settings&lt;br /&gt;
|-&lt;br /&gt;
| TFCdisplay || change the TFC display (e.g. power/amplitude, coherence)&lt;br /&gt;
|-&lt;br /&gt;
| TFCsave || save numerical results to an ASCII file, or save a screenshot of the TFC window&lt;br /&gt;
|-&lt;br /&gt;
| TFCimage || start beamformer analysis on a selected time-frequency range&lt;br /&gt;
|-&lt;br /&gt;
| TFCSendToMATLAB || send TF results or single-trial data to MATLAB&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How to Average Your Data in a Batch  ===&lt;br /&gt;
&lt;br /&gt;
Using batch processing, several files from an experiment can be averaged at a time.&lt;br /&gt;
&lt;br /&gt;
Here we summarize the steps required:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Create the paradigm, and save the paradigm file.&lt;br /&gt;
* Open each individual data file to check the data:&lt;br /&gt;
** Make sure auxiliary files are defined and loaded properly, and the data are displayed correctly.&lt;br /&gt;
** Eyeball the data.&lt;br /&gt;
** Define bad (and interpolated) channels.&lt;br /&gt;
** Mark artifact time ranges.&lt;br /&gt;
** If required, set up artifact correction for the file.&lt;br /&gt;
** The data file can be closed again after this step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Preparing the batch'''&lt;br /&gt;
&lt;br /&gt;
* Open at least one&amp;amp;nbsp;file and select ''Process / Batch Scripts''.... The file(s) should be displayed in the file list. Alternatively, just select ''Process / Batch Scripts...,'' and add the files by&lt;br /&gt;
** pressing the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** dragging the files from Windows Explorer&lt;br /&gt;
** Opening a previously saved&amp;amp;nbsp;list with ''Load File List''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* You can delete files from the list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt;) or edit the file sequence using the right click context menu.&lt;br /&gt;
* Select the ''Batch Tab''.&lt;br /&gt;
* Add commands to your script. For averaging, these would normally be&lt;br /&gt;
** '''Paradigm''' -- to load the paradigm file&lt;br /&gt;
** '''Artifact Scan''' -- to run the artifact scan&lt;br /&gt;
** '''Average''' -- to perform the average&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Save these commands (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Test the commands on the files in the current file list: press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Look at the log file (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;) to check the results of averaging.&lt;br /&gt;
* Look at the data averages to make sure they have been done correctly.&lt;br /&gt;
* Repeat these steps until averaging is working properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Select ''Process / Batch Scripts''....&lt;br /&gt;
* Open the files you want to average in the batch in the file list:&lt;br /&gt;
** Any files that were open in BESA are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Edit the file list, e.g. delete unwanted files (use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; key or the right click context menu), or reorder the files (use &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl + cursor keys'''&amp;lt;/span&amp;gt; or context menu).&lt;br /&gt;
* Note that the order of files in the list specifies the order in which they will be processed in the batch script. This order will be important if all results are saved to the same target file. Otherwise the file sequence is not important.&lt;br /&gt;
* Optionally, save the file list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Select the ''Batch Tab'', and load the previously defined batch script with ''Load Batch''.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch.&lt;br /&gt;
&lt;br /&gt;
=== How to Merge and Compress raw data  ===&lt;br /&gt;
&lt;br /&gt;
Using the Export command in a batch, several data files can be merged into a single data file in BESA's data format (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.foc&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This can be useful if data from one subject have been collected in several data blocks, and you want to analyze all data blocks together.&lt;br /&gt;
&lt;br /&gt;
Optionally, to save space, data can be saved in compressed format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Files can be merged:'''&lt;br /&gt;
&lt;br /&gt;
* if they have identical channel configurations, or&lt;br /&gt;
* there are at least 16 EEG channels, and the export format is Standard 81 (i.e. EEG channels are interpolated to 81 standard locations). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''How to merge files:'''&lt;br /&gt;
&lt;br /&gt;
* Select '''Process / Batch Scripts...'''&lt;br /&gt;
* Add all the files that are to be merged to the file list:&lt;br /&gt;
** Any files that were open in BESA Research are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list (''Load File List'').&lt;br /&gt;
* Rearrange the files in the file list to the sequence in which they should be merged.&lt;br /&gt;
* Select the ''Batch Tab ''and insert an &amp;quot;''Export&amp;quot;'' command, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following dialog shows a possible configuration of the ''Export'' command:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The parameters shown in the Information box are the settings chosen in the ''Export Dialog'' when the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt; button has been pressed.&lt;br /&gt;
* '''Append if file already exists''' must be checked in order to merge the files.&lt;br /&gt;
* The '''target file name''' must be fixed, i.e. don't use the '''%basename%''' variable, because that will result in a different target file name for each source file.&lt;br /&gt;
* There are two variables that can be used for the segment label:&lt;br /&gt;
** '''%filename%''' will insert the basename of the source file into the segment label.&lt;br /&gt;
** '''%c%''' will insert the file number into the segment label. The number gives&amp;amp;nbsp;the position of the file in the file list. For instance, &amp;quot;File %c%&amp;quot; will generate the label &amp;quot;File 2&amp;quot; for the second file in the list.&lt;br /&gt;
&lt;br /&gt;
=== Example: Data averaging in the auditory intensity experiment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, two raw data files, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;, from the auditory intensity experiment will be batch averaged.&lt;br /&gt;
&lt;br /&gt;
Please note that there are further tutorials covering this experiment. The first file is contaminated by many eyeblinks, and more epochs would be averaged if eye correction were used (see Viewlet demonstration on artifact correction on the BESA website). However, in this tutorial we will just use artifact rejection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Various ways of creating a File List'''&lt;br /&gt;
&lt;br /&gt;
1. '''Files that were open in BESA Research are automatically added to the File List.''' Start BESA Research and open the files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt '''&amp;lt;/span&amp;gt;in the directory ''Examples\ERP-Auditory-Intensity''.&lt;br /&gt;
&lt;br /&gt;
2. Select ''Process / Batch Scripts''.... You should see the file names in the '''''File List Tab''''' something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. You can resort the files in the file list alphabetically by clicking onto the '''''File List column header''''':&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can mark any file, hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;key and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrow '''&amp;lt;/span&amp;gt;to move the file name up or down the list. This is the sequence in which files will be processed in the batch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; and save the list you have created to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Highlight both names and press the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
6. '''Files can be dragged from Windows Explorer'''. Start Windows Explorer and navigate to the ''ERP-Auditory-Intensity'' subdirectory of your BESA Research examples folder (located in the ''Public Documents'' folder of your computer). Click on &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and drag it with the mouse onto the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''''File List Tab'''''. Let go of the mouse. BESA Research opens the file, and displays the name in the File List. Repeat for &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt.'''&lt;br /&gt;
&lt;br /&gt;
7. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
8. '''Files can be added using the ''Add File'' button'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; and navigate to the ''Examples\ERP-Auditory-Intensity'' subdirectory. Select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt;. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl'''&amp;lt;/span&amp;gt; and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;. Both names should then be displayed in the ''File Open'' dialog. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to add the files to the file list.&lt;br /&gt;
&lt;br /&gt;
9. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
10. '''Files can be loaded from a previously saved file list'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List '''&amp;lt;/span&amp;gt;and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;, the list you saved in step 6 above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Setting up the batch'''&lt;br /&gt;
&lt;br /&gt;
1. We will add three commands, '''Paradigm''', '''Artifact Scan''', and '''Average''', to create a batch that will be applied to the two files in the file list.&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''Batch Tab'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button to obtain the ''Select Command'' window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (9).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt; and then on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; (alternatively, double-click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt;). Hit &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Browse'''&amp;lt;/span&amp;gt;, navigate to the ''Auditory'' folder, and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''AEP_Intensity.pdg'''&amp;lt;/span&amp;gt;, the paradigm for the auditory intensity experiment.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (10).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to obtain the ''Load Paradigm Task'' window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (11).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;, and the first task in the batch is ready, and listed in the Batch Command window. If you want to modify the command, double-click on it to open the above window, that allows to browse for a different paradigm file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (12).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Next, we add the '''Artifact Scan''' command. Click on the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select ''Artifact Scan.''&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (13).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Artifact Scan Task'' window. We want to be able to view the results of the scan, and adjust thresholds and bad channels if necessary. Therefore, check the ''Wait after scan'' checkbox.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (14).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to close the ''Artifact Scan Task'' window. Our batch now contains two commands.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (15).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Finally, we will add an '''Average''' command. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button and select ''Average''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Average Task ''window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (16).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. With the default settings, the average would be saved to the same directory as the data. The file name mask is set by default so that in this example the two averages would be saved to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1-av.fsg '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2-av.fsg'''&amp;lt;/span&amp;gt;. We will save the averaged files to subdirectory ''&amp;quot;Averages''&amp;quot; of the data directory. Uncheck the ''Use default target'' check box, change the File name mask to '''%basename%_av-test''' in order not to overwrite the predefined files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (17).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Average Task'' window. Our batch is now complete.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (18).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
13. We will now save the batch so that it can be used again. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt; button, and save to the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-ex1.bbat'''&amp;lt;/span&amp;gt;. Note that an easy way to generate new averaging batches is to load a previously save batch and edit the commands -- it may only be necessary to edit the '''Paradigm''' command to select the relevant paradigm file, and maybe to adjust the target directory in the '''Average''' command.&lt;br /&gt;
&lt;br /&gt;
14. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch'' Window to start the batch running. As requested, the batch pauses after the artifact scan:. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (19).gif]]&lt;br /&gt;
&lt;br /&gt;
You may now adjust the number of rejected trials, e.g. by moving the vertical red bar to the left, or exclude bad channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to continue with averaging.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (20).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
16. Note that, in the background, the ''Batch Running'' window is providing feedback about the current file and current task.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
17. The batch will stop again after the next artifact scan. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to allow the batch to run to the end.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (21).gif|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
18. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log'''&amp;lt;/span&amp;gt; to view the batch protocol. If you are using Internet Explorer or Netscape family (Mozilla, Firefox) browsers, and JavaScript is enabled, you will first see just batch titles defined by the date and time the batch was started. The most recent title is at the top of the list. For other browsers, or if JavaScript was not enabled, all protocol texts are expanded as in 19 (below).&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (22).gif|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
19. Click on the first title to expand its protocol. Here, for example, the protocol gives feedback about the number of epochs that were averaged for each file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (23).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
20. Finally, press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to return to the main BESA Research display. Open the averages in the ''Averages'' subdirectory to confirm that they were generated properly.&lt;br /&gt;
&lt;br /&gt;
=== Example: Merging files using the Export Command ===&lt;br /&gt;
&lt;br /&gt;
Here we will demonstrate the use of the '''Export '''command to merge two files. We will combine the two averages from the previous example (Data averaging in the auditory intensity experiment) into one target file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Generate the file list'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and load the two data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av-test.fsg'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2_av-test.fsg'''&amp;lt;/span&amp;gt; that were saved in the previous example.&lt;br /&gt;
# Select ''Process / Batch Scripts....''The two file names should be displayed in the file list.&lt;br /&gt;
# In the file list, make sure that &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1_av-test.fsg '''&amp;lt;/span&amp;gt;is the first file in the list. If it is not, highlight the file, and move it up using &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl+up'''&amp;lt;/span&amp;gt;, or right click and select ''Move Up'' in the context menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Generate the batch'''&lt;br /&gt;
&lt;br /&gt;
1. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select the '''Export''' command.&lt;br /&gt;
&lt;br /&gt;
2. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Export Task'' window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (24).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt;... button to open the ''Export Dialog''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (25).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Since we are combining averages, select ''Hires (no compression)'' in the '''Target data format''' drop-down list (If we were merging raw data files, it is better to select compression. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the dialog. Check'' Append if file already exists'', so that the files will be merged. Enter '''s1+s2''' in the target file name mask edit box. This ensures that both files will be saved to the same target: &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (26).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Export Task'' window. The '''Export '''command is displayed. &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (27).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Optionally, you may save the batch file by pressing &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
7. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch, and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch Completed'' window to return to the BESA main window.&lt;br /&gt;
&lt;br /&gt;
8. Finally, open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt; to confirm that it contains the two merged files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Merge raw data'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Repeat the above task to merge the two raw data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2.cnt'''&amp;lt;/span&amp;gt; into a single target file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.foc'''&amp;lt;/span&amp;gt;. In this case, select one of the compression options as the target data format. Note that you would not normally want to merge two files from different subjects. However, several data blocks from the same subject can conveniently be merged using this method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; files can also be merged using the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''Combine Conditions''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; dialog. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions, Channels ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Combine Condition Scripts ===&lt;br /&gt;
&lt;br /&gt;
With the Combine-Conditions module you can do a variety of operations on BESA averages (files with the extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, and other segment files, such as &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.mul&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.swf&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* Create grand averages&lt;br /&gt;
* Combine averages (add, subtract, weighted/unweighted)&lt;br /&gt;
* Merge files&lt;br /&gt;
* Exclude unwanted averages&lt;br /&gt;
* Rename conditions&lt;br /&gt;
* Rename or resort channels&lt;br /&gt;
* Generate averages or differences over selected channels&lt;br /&gt;
* Transform the data: standard interpolated 81 electrodes, change sampling rate, change interval&lt;br /&gt;
* Determine peaks, mean amplitudes, or integrals on data averages&lt;br /&gt;
* These operations can be performed on one or more files simultaneously. Results of an operation are stored in a single target file.&lt;br /&gt;
&lt;br /&gt;
The module includes four tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* File List: Define a list of files on which the operations will be performed.&lt;br /&gt;
* Condition List: List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
* Channel List: List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
* Run Scripts: Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak analysis). Start the operation.&lt;br /&gt;
* Note that in all four tabs, configurations can be saved for future use, and the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button restores the most recently used configuration.&lt;br /&gt;
&lt;br /&gt;
=== Condition List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
&lt;br /&gt;
The first column of the&amp;amp;nbsp;list box shows a list of all the condition names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the source conditions. Columns define the target conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each condition name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target conditions will have the same name as source conditions. Right click on source condition labels to view properties (e.g. no. of samples, time range, sampling rate).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (28).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the condition list'''&lt;br /&gt;
&lt;br /&gt;
* Target condition names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: conditions can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over conditions, the sum is divided by the number of conditions, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;''Divide result by sum of PLUS factors''&amp;quot; is unchecked, the conditions will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between conditions, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the condition list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Weighting of averages'''&lt;br /&gt;
&lt;br /&gt;
* Below the list, click on the ''Weighted Average'' row to toggle &amp;quot;YES&amp;quot; and &amp;quot;NO&amp;quot;. &amp;quot;YES&amp;quot; means that averages will be weighted by the number of epochs contributing to the average. For instance, if average A contained 100 epochs and average B contained 200 epochs, the weighted average will be computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(100 * A + &amp;amp;nbsp;200 * B) / (100 + 200)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Select &amp;quot;NO&amp;quot; for an unweighted average. For the above example, the average is computed as&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(A + B) / 2&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Weighted averages are not permitted if one of the boxes contains a negative value.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Values other than +1 or -1 in the boxes apply a different kind of weighting. For instance, we want to compute the difference between the means of conditions A, B, C and D, E. Use a right click to specify the fraction 1/3 for each of A, B, and C, and -1/2 for each of D and E (see example below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (29).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Feedback'''&lt;br /&gt;
&lt;br /&gt;
* Conditions that have different numbers of electrodes (averaging across different files) can only be combined if channels are interpolated to a standard set of electrodes.&lt;br /&gt;
* Conditions that have different durations or sampling rates can only be combined if the sampling rate and durations are made the same.&lt;br /&gt;
* Feedback about the above situations is displayed by the presence of tick marks above the list box.&lt;br /&gt;
&lt;br /&gt;
=== Channel List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
&lt;br /&gt;
Note that this tab is very similar in usage to the '''Condition List Tab'''. Note also that some of the functions performed in this tab could also be done in the Montage Editor. It may be a matter of convenience whether you choose to perform these operations here or in the Montage Editor.&lt;br /&gt;
&lt;br /&gt;
The first column of the list box shows a list of all the channel names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the ''source'' channel. Columns define the'' target'' channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each channel name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target channel will have the same name as source channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Combining files'''&lt;br /&gt;
&lt;br /&gt;
If files with different channel configurations are included in the File List, the rows and columns of the Channel List Tab will only contain the labels for the channels that are in common among the files.&lt;br /&gt;
&lt;br /&gt;
If the files in the File List have a different sequence of channels, the sequence of the first file in the list will be adopted in the Channel List.&lt;br /&gt;
&lt;br /&gt;
Thus, for the initial setting, unless the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked, the target grand average or peak/amplitude analysis, etc. will be applied using only channels that are in common among the input files, and using the channel sequence of the first file in the File List. By changing the target channels or by changing the entries in the Channel List, new channels consisting of averages or differences can be generated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''What can the Channel List be used for?'''&lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
&lt;br /&gt;
* Reorder or relabel channels&lt;br /&gt;
* Create channel differences&lt;br /&gt;
* Create averages over channel groups, e.g. for peak analysis&lt;br /&gt;
* Extract a selection of channels for peak analysis or mean amplitudes&lt;br /&gt;
* Create grand averages across files with different channel configurations, just using channels in common among the files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (30).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the channel list'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Target channel names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: channels can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over channels, the sum is divided by the number of channels, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;Divide result by sum of PLUS factors&amp;quot; is unchecked, the channels will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between channels, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the channel list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Channel List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Channel List&amp;amp;nbsp;'''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
=== Run Scripts Tab ===&lt;br /&gt;
&lt;br /&gt;
Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak detection. Start the operation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load or Save Settings'''&lt;br /&gt;
&lt;br /&gt;
* You can save the current settings of this tab to a file (*.run) which can be loaded later.&lt;br /&gt;
* When you run the script, the current settings are saved automatically to a file &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* Press this button to load the previous settings (from &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Averages to Generate'''&lt;br /&gt;
&lt;br /&gt;
* '''Generate separate averages for each source file'''. Averages are performed over conditions within the source file, and are then appended to the target file.&lt;br /&gt;
* '''Combine data from source files'''. Conditions are combined over all source files into a single target average.&lt;br /&gt;
* '''No averages, just copy'''. Files are copied and merged to the target file. Use this option for renaming conditions, merging files, removing unwanted averages (see below), changing the sampling rate and interval.&lt;br /&gt;
* '''Peaks and mean amplitudes'''. Specify time ranges for peaks, mean amplitudes, or integrals (areas).&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note: When generating or copying averages (first three options), filters and baseline settings are turned off. For Peaks and mean amplitudes, filters and baseline settings are specified in the dialog.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Spatial Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Interpolate to Standard 81 electrodes'''. The target file will contain only electrodes (other channels are omitted), using the Standard 81 configuration (as in other export functions within BESA Research). This cannot be selected if the source data contain less than 16 EEG channels.&lt;br /&gt;
* '''Interpolate Bad Channels'''. Bad electrode channels in the source file will be interpolated. If the above option is deselected and bad channels exist in one or more of the source files, this option is always on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;BESA Research can interpolate EEG, and MEG if the sensors are axial gradiometers or magnetometers. If other channels are marked as bad in one or more of the source files, these will be defined as bad in the target file. This applies to MEG planar gradiometers, to polygraphic data, and to ICR channels.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Temporal Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Spline to New Sampling Rate and Interval'''. Data can be converted to a new sampling rate, and the interval can be changed.&lt;br /&gt;
** If the sampling rate is reduced, the data will be low-pass filtered at 1/3 sampling frequency before reduction.&lt;br /&gt;
** If the sampling interval is changed, the prestimulus and poststimulus intervals are limited by the smallest intervals in the conditions contributing to the averages. These limits are shown below the edit boxes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks and Mean Amplitudes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (31).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range between which peaks are to be determined.&lt;br /&gt;
* Select the montage on which the peaks are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Define the baseline settings.&lt;br /&gt;
* Specify whether peaks are to be defined at one latency: if so, select the channel on which peaks are to be detected.&lt;br /&gt;
* Specify whether you want to find positive or negative peaks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Mean amplitudes and areas:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range over which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Select the montage on which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Note that when computing areas, data are first rectified (made positive) and then summed over the time range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Output options of the analysis:'''&lt;br /&gt;
&lt;br /&gt;
* A single ASCII file that contains the result of the analysis for all data sets, conditions, and channels including header and information lines.&lt;br /&gt;
* A sparse output suitable for import in SPSS. Each variable (e.g. a latency, a channel amplitude) constitutes one column of the output file.&lt;br /&gt;
* Direct transfer to MATLAB into a struct besa_peak. For more information on the data transfer from BESA Research to MATLAB, please refer to help chapter ''“The MATLAB interface”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Starting the Operation'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;to start the operation. After the operation is completed, and the &amp;quot;Open target file in BESA&amp;quot; box is checked, BESA Research will open the target file. &amp;amp;nbsp;&amp;quot;Open target file in BESA&amp;quot; cannot be checked if &amp;quot;Peaks and mean amplitudes&amp;quot; was selected - then the result of the operation will be an ASCII file or a MATLAB transfer.&lt;br /&gt;
* You will be asked for the name of the target file (unless a MATLAB transfer of peak data has been performed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Restrictions'''&lt;br /&gt;
&lt;br /&gt;
* Depending on source file configurations, not all options above are selectable. For instance, if two files contain different numbers of electrodes, and the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked in the '''''Channel List''''' Tab, spatial interpolation to Standard 81 is enforced in the target. Similarly, if different sampling rates are used in different files, temporal interpolation is enforced.&lt;br /&gt;
* You are not allowed to add files to the file list if the channel configuration is different, and the data cannot be combined with Standard 81 interpolation. Since Standard 81 interpolation is only possible for EEG, multiple files without EEG can only be loaded if they have the same number of channels.&lt;br /&gt;
&lt;br /&gt;
=== How to Create Grand Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to average in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To average across different conditions, click in the list boxes to obtain &amp;quot;+1&amp;quot; for each source condition to combine, and rename the target condition to define a meaningful name for the average.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Generate Differences Between Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To create differences, click in the list boxes to obtain &amp;quot;+1&amp;quot; for one of the source conditions, and &amp;quot;-1&amp;quot; for the source condition to subtract, and rename the target condition to define a meaningful name for the difference.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. An average of the differences is generated. If only one example of each condition exists, e.g. in a grand average file, the result is the difference between conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Merge Files ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to merge in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notes'''&lt;br /&gt;
&lt;br /&gt;
* If the source files have different electrode configurations, use the Standard 81 configuration for the target.&lt;br /&gt;
* If the source files have different sampling rates or intervals, use Temporal Interpolation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Remove Unwanted Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted segments'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as averages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted conditions (by label)'''&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Deselect the target conditions you want to omit (replace the &amp;quot;+1&amp;quot; by a blank).&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as artifacts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Rename Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. Click on column headings to rename the target conditions.&lt;br /&gt;
* Click on the''' Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data with the renamed conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Change the Sampling Rate ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file(s) you want to change in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...'').&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Select &amp;quot;''Spline to New Sampling Rate and Interval''&amp;quot; and type the new sampling rate into the edit box.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Create grand average and combinations of conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, we will generate a grand average of the results of the Auditory Intensity Experiment. The experiment includes averages from five different stimulus intensities. We will create a grand average over each intensity, but also include means over the two lowest and the two highest intensities, and the difference between these two combinations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av.fsg - S10_av.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The files contain the individual averaged data of the 10 subjects who participated in this study.&lt;br /&gt;
# Select ''ERP / Combine Conditions...'' The file list should display the two files, with feedback about the number of averages and conditions. 8 epochs are found. See the ''“Data averaging in the auditory intensity'' ''experiment”'' example for examples how to manipulate the file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (32).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. The initial window defines target conditions with the same name as the source conditions. To generate the grand average over these conditions we could proceed without further changes to the '''Run Scripts Tab'''. However, we want to modify the condition list and create a condition that contains the grand averaged difference between the''' High''' and '''Low''' conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''All '''column label. In the resulting window, rename condition '''All''' to''' Difference'''. Then press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (33).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. The last column is now labeled '''Difference.''' Left-click twice onto the ‘'''+1’''' entry that links this condition to the '''All '''input condition. This will remove the link and leave the field blank. To define the ‘Difference’ condition as the average of ‘High’ minus ‘Low’ over subjects, left-click once into the field linking input '''High''' with target '''Difference''' to generate an entry ‘'''+1’''' in this field. Left-click twice into the field linking input '''Low '''with target '''Difference''' to generate an entry '-'''1'''’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;[[Image:Batch processing (35).gif]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; and save the list to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ER&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;P-aud-ex1.clist'''&amp;lt;/span&amp;gt;. This condition combination can thus be loaded later using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Click on the '''Run Script Tab'''.&lt;br /&gt;
# The default tab settings are ready for generating the grand average ('''Combine data from source file''' and '''Open target file in BESA''' should be checked). Just press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Enter &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_cc-test.fsg'''&amp;lt;/span&amp;gt; as file name and press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Save'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The resulting file contains the 8 target conditions, 60db, 70dB, 80dB, 90dB, 100dB, Low, High, and Difference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Average files from different experiments ===&lt;br /&gt;
&lt;br /&gt;
This example is intended to illustrate several features of the ''Combine Conditions'' Dialog, such as electrode interpolation and resampling. We will combine an average from the Auditory Intensity experiment with one from the P300 auditory experiment. In this particular case, it is not a very meaningful thing to do, but it shows what is possible. For instance, the same experiment may have been performed using different sampling rates or electrode combinations. This example shows how such data may be combined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_GA.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The file contains the grand average data from the auditory intensity experiment.&lt;br /&gt;
# Open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''RareFrequentResponseLeft.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-P300-Auditory'' folder. This file contains averages from the P300 auditory experiment.&lt;br /&gt;
# Select ''ERP / Combine Conditions... ''Note that the files have different sampling rates and different numbers of electrodes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (36).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. Note that the feedback text at the bottom of the window displays the text &amp;quot;Standard 81 interpolation required to generate average; Across files: resampling or change in time range required to generate average&amp;quot;. The condition labels show all the names from both files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (37).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.  We will exclude most conditions, and just combine the most similar conditions from the two experiments: the &amp;quot;Standard&amp;quot; and the &amp;quot;80dB&amp;quot; conditions. Click on the title of the first column,''' Blink'''. Select “''Delete all conditions to the right of this column”'', and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (38).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on the title again, and rename the target condition to &amp;quot;Standard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (39).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click twice in the first line to remove the &amp;quot;+1&amp;quot; entry there. Click once in the third row (&amp;quot;Frequent&amp;quot;), and in the 7th row (&amp;quot;80dB&amp;quot;), to display &amp;quot;+1&amp;quot; at each entry. Thus, just two of the conditions will be combined into one target condition.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (40).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Run Script Tab'''. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (41).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Note that '''Interpolate to Standard 81 electrodes''' is checked and grayed: since two different electrode sets are to be combined, we can only do this by interpolating electrodes. Also, both '''Spline to new sampling rate''' and '''Clip interval '''are checked and grayed. Again, these settings are required in order to be able to average the two data files together. The sampling rate is set to the higher of the two selections. The time range is set to the largest possible range that can be clipped from the two data sets. For now, leave these settings as they are, and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Save the target to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''TestCombineExpts_CC-std81.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing</id>
		<title>BESA Research Batch Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=BESA_Research_Batch_Processing"/>
				<updated>2021-05-05T07:30:23Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: Reverted edits by Mateusz (talk) to last revision by Jamie&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==  Batch Processing and Combining Conditions == --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions and Batch Module: Introduction ==&lt;br /&gt;
&lt;br /&gt;
Functions of this module are started by selecting the menu operations &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''ERP / Combine Conditions...'''&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Batch Scripts...'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''Combine Condition Scripts''' provides various operations on BESA averages.&lt;br /&gt;
* '''Batch Scripts''' provides batch operations on all data files.&lt;br /&gt;
* Note that a batch script can also be performed on the current file by selecting &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Process / Run Batch...'''&amp;lt;/span&amp;gt;&amp;quot; or by typing the shortcut key &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''R'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== File List Tab ==&lt;br /&gt;
&lt;br /&gt;
Define a list of files on which the operations will be performed. The tab is the same for Combine Conditions Scripts and for Batch Scripts. Combine Conditions Scripts only allows you to open BESA average files (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, but also &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.raw'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.swf'''&amp;lt;/span&amp;gt;, and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt; if the files have a defined pre-stimulus interval), whereas Batch Scripts allows you to open any data file whose format is known to BESA Research.&lt;br /&gt;
&lt;br /&gt;
When the Combine-Conditions or the Batch module is started, all currently opened (Combine-Conditions: averages only) files are displayed in the list.&lt;br /&gt;
&lt;br /&gt;
To the right of each file name, the number of electrodes, total number of channels, and the sampling rate used in the file are displayed. In the Combine-Conditions module, the number of Epochs (segments) and the number of differently-named conditions are also shown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add files to the list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File '''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
* Drag one or more files from Windows Explorer onto the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Remove files from the list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and confirm the delete operation in the resulting dialog.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key to mark multiple files). Right click to obtain the context menu and select &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;quot;, or just press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Reorder files within the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Right click on the file name and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;.&lt;br /&gt;
* Mark one or more file names in the list (e.g. hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctr'''&amp;lt;/span&amp;gt;l key to mark multiple files). Right click to obtain the context menu and select &amp;quot;'''''Move Up'''''&amp;quot; or &amp;quot;'''''Move Down'''''&amp;quot;, or hold down the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Ctrl'''&amp;lt;/span&amp;gt; key '''and '''press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrows'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sort the current file list alphabetically'''&lt;br /&gt;
&lt;br /&gt;
* Click on the File bar above the list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a file list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List'''&amp;lt;/span&amp;gt; button, or the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button to load the most recently used file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Which conditions are read from a source file? (Combine-Conditions module only)'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File list from Combine Conditions:'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (1).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Don't try to open here... (Batch only)'''&lt;br /&gt;
&lt;br /&gt;
By default, this checkbox is unchecked.&lt;br /&gt;
&lt;br /&gt;
In the checked state, BESA Research doesn't check if it can open the file. Use this function '''only''' if the file is ASCII and you want to use the '''ImportASCII '''batch command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''File List from Batch Scripts''':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (2).png]]&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Batch Processing &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== Batch Processing Scripts ===&lt;br /&gt;
&lt;br /&gt;
With Batch Scripts, you can define a set of operations (e.g. Artifact Scan, Average) and apply these to several data files.&lt;br /&gt;
&lt;br /&gt;
These operations include&lt;br /&gt;
&lt;br /&gt;
* Load Paradigm&lt;br /&gt;
* Artifact Scan&lt;br /&gt;
* Average&lt;br /&gt;
* Export (and Merge)&lt;br /&gt;
* File Open (switch to another data file)&lt;br /&gt;
* Set filters&lt;br /&gt;
* Specify a montage (used, for example, for export to current montage)&lt;br /&gt;
* Run automatic eye and EKG artifact correction&lt;br /&gt;
* Turn artifact correction and view on and off&lt;br /&gt;
* Read and write events&lt;br /&gt;
* Edit default block epoch (for export around triggers)&lt;br /&gt;
* Edit triggers (for export around triggers)&lt;br /&gt;
* Mark a block for export, or send the block to Source Analysis or Top View&lt;br /&gt;
* Convert patterns to triggers&lt;br /&gt;
* Attach auxiliary files (e.g. elp, sfp) to the data file&lt;br /&gt;
* Send to MATLAB&lt;br /&gt;
* Specify display configurations for the BESA Research Main, SA, and Top View windows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An additional set of commands are available for operations in the '''Source Analysis Module''', allowing to load, create and fit dipole models, and save the results.&lt;br /&gt;
&lt;br /&gt;
A further set of commands apply to '''Time-Frequency Analysis''', allowing to start TFC, change the display, save results, and run the beamformer or DICS analyses on a selected time-frequency range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (3).png]]&lt;br /&gt;
&lt;br /&gt;
These operations will be extended in future program releases.&lt;br /&gt;
&lt;br /&gt;
The module includes two tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* '''File List''': Define a list of files on which the operations will be performed.&lt;br /&gt;
* '''Batch''': Define or load '''batch commands'''. Run the batch.&lt;br /&gt;
&lt;br /&gt;
=== Batch Tab ===&lt;br /&gt;
&lt;br /&gt;
Load or define batch commands, and then apply them to the files in the File List.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Add Command'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; to add a new command to the batch. The following dialog is opened, showing the available commands:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (3).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Select the desired command and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; or double-click on the command. A dialog box is opened, allowing to specify individual command parameters.&lt;br /&gt;
* If you click on &amp;quot;Apply at beginning of batch&amp;quot; or &amp;quot;Apply at end of batch&amp;quot;, the command will only be run at the beginning or the end of a batch. You can use this, for example, at the end of a batch to start a Matlab script to perform statistics on the results of the batch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load and Save Batch'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load a previously defined batch or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to save the current batch to a file (&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.bbat&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;).&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; to load the most recently used batch file. Whenever a batch is run, the current set of commands is written to the file &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Previous.bbat in'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Scripts/Batch'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; subdirectory. This file is loaded when you press &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Clear All'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Clears all commands from the window.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''View Log File'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Each time a batch is run, BESA Research adds information about the batch to a log file, with headings showing the date and time the batch was started. The file is opened automatically in Internet Explorer if errors occurred during processing. Otherwise you may open the file by &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button here or in the dialog that is displayed at the end of batch processing. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;The log file is saved in xml format, and a JavaScript is used to format the display in Internet Explorer or Netscape family browsers. JavaScript should be enabled in the browser to obtain an optimal display of the results. If JavaScript is enabled, the log file is displayed as a list of headings for each batch. Click on a heading to display the results of the corresponding batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;To open the log file in NotePad, hold the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Shift '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;key down when pressing the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; button.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Batch Command List'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Double-click on a command to edit it. See chapter “&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''Batch Commands”''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; for descriptions of the dialogs that are opened to edit each command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Right click on a command to open a context menu allowing more options.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Move Up'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''and Move Down'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; can also be applied to multiple selections.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If you have made a multiple selection, the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;button will delete all the marked commands. &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;plus &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''cursor keys'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will move the marked commands up or down.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Comment'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove a semicolon (;) in front of the command, to deactivate or reactivate the command.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'''Toggle Command Only at Start/End'''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; will add or remove the text &amp;quot;Start_&amp;quot; or &amp;quot;End_&amp;quot; in front of the command. With these prefixes, the command will only be performed when the first file (&amp;quot;Start_&amp;quot;) or the last file (&amp;quot;End_&amp;quot;) in the file list is being processed.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Single Step Mode'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Check this item to step through the batch, one command at a time. A dialog is opened after each command, allowing to run the next command, continue the batch without single steps, or stop running the batch. See the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;'' “Pause''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;” command for further details.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;During a batch, press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changes in batch written to database'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;Checked by default. If this item is unchecked, file display settings, such as Montage setting and Artifact correction display, are not written to the database. When the file is next opened in BESA Research, the settings made in the batch are not retained.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Leave files in the file list open after running the batch'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;If this item is checked, files in the file list will remain open after the batch. This is useful, for instance, if you want to open a set of files, specifying the same montage and/or filter settings for each file.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to start running the batch. Each command is then applied in succession to each file in the File List.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that, while a batch is running press and hold down the&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Pause'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; or &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Delete'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to interrupt the batch and enter Single Step Mode. Press and hold down the &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Esc'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; key to cancel the batch.&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The log file ===&lt;br /&gt;
&lt;br /&gt;
A protocol of each batch is written to the log file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Scripts/Log/Batch.xml.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File '''&amp;lt;/span&amp;gt;button, the file is opened in your default browser for xml files. The file will be opened automatically if there was an error during batch processing, unless you have used the ''BatchError'' batch command to suppress this behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''DHTML formatting of the log file'''&lt;br /&gt;
&lt;br /&gt;
The xml file is formatted using JavaScript (Dynamic HTML). If JavaScript is enabled in your browser, you will first see a list of batch protocol titles, labeled by the date and time at which the batch was started. The most recent batch is at the top of the list.:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).png|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the title to view the protocol for the corresponding batch:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''JavaScript and XP Service Pack 2'''&lt;br /&gt;
&lt;br /&gt;
By default, if the log file is opened in Internet Explorer after XP Service Pack 2 has been installed, IE will warn you with the message: &amp;quot;''To help protect your security, Internet Explorer has restricted this file from'' ''showing active content that could access your computer&amp;quot;.'' All the protocols in the log file are displayed. You may safely click on the options to allow active content in the log file, if you want to display the file as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Backup of the log file'''&lt;br /&gt;
&lt;br /&gt;
When the log file is written, a backup of the previous version is written to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml.bak'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the size of the log file exceeds 200 KB, it is renamed to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml_date_time'''&amp;lt;/span&amp;gt; (e.g. &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Batch.xml_2004-10-08_10-53-32'''&amp;lt;/span&amp;gt;), and a new version of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''batch.xml'''&amp;lt;/span&amp;gt; is created.&lt;br /&gt;
&lt;br /&gt;
=== Placeholders ===&lt;br /&gt;
&lt;br /&gt;
A powerful feature of the batch commands is the ability to define file names and specify standard paths using placeholders. These are text strings enclosed by percentage (%) signs. They can be used in all batch commands where file names are specified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Basename'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Placeholder !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; width=&amp;quot;10%&amp;quot;|'''%basename%'''&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|replaced by the basename of the data file in the File List.&lt;br /&gt;
|width=&amp;quot;40%&amp;quot;|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%basename-n%'''&lt;br /&gt;
|replaced by the basename of the data file in the File List, but removing the last &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%-nbasename%'''&lt;br /&gt;
|replaced by the basename of the data file in the File List, but removing the first &amp;quot;n&amp;quot; characters from the name.&lt;br /&gt;
|If the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%scripts%'''&lt;br /&gt;
|replaced by the path to the Scripts folder.&lt;br /&gt;
|&amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard Matlab scripts used by BESA Research.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%montages%'''&lt;br /&gt;
|replaced by the path to the Montages folder.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot;|'''%examples%'''&lt;br /&gt;
|replaced by the path to the Examples folder.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''%basename%''' -- replaced by the basename of the data file in the File List. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename%-export.fsg&amp;lt;/span&amp;gt;&amp;quot; will be interpreted as &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;f-spike-export.fsg&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''%basename-n%''' -- replaced by the basename of the data file in the File List, but removing the last &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle-BB.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%basename-3%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the last 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%-nbasename%''' -- replaced by the basename of the data file in the File List, but removing the first &amp;quot;n&amp;quot; characters from the name. For example, if the data file is named &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BB-dongle.fsg&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%-3basename%&amp;lt;/span&amp;gt;&amp;quot; will be replaced by &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;dongle&amp;lt;/span&amp;gt;&amp;quot;, because the first 3 characters of the basename have been removed.&lt;br /&gt;
&lt;br /&gt;
* '''%scripts%''' -- replaced by the path to the Scripts folder (e,g, &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%Batch&amp;lt;/span&amp;gt;&amp;quot; is where batches are saved by default; &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;%scripts%MATLAB&amp;lt;/span&amp;gt;&amp;quot; is the location of the standard Matlab scripts used by BESA Research).&lt;br /&gt;
&lt;br /&gt;
* '''%montages%''' -- replaced by the path to the Montages folder.&lt;br /&gt;
&lt;br /&gt;
* '''%examples%''' -- replaced by the path to the Examples folder.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Placeholders for folders'''&lt;br /&gt;
&lt;br /&gt;
The following placeholders are the same as those used in the [Folders] section of &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''Besa.ini'''&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The strings enclosed by percent signs (%) are placeholders for the following folders in English-language versions of Windows. Folder names are different for Vista and XP/2000 and for other language settings. BESA Research will substitute the placeholders by the appropriate folder name for the system (W2K, XP, Vista, or Win7) and the system language:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 7 (English)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%localapp%''' = &amp;quot;C:\Users\[user]\AppData\Local\BESA\Research_5_3&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Desktop as &amp;quot;Desktop\[user]\AppData\Local\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt; '''%publicprog%''' = &amp;quot;C:\Users\Public\Public Documents\BESA\Research_5_3&amp;quot;. This folder is directly accessible from the Windows Explorer under &amp;quot;Libraries\Documents\Public Documents\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;C:\Users\[user]\Documents\BESA\Research_5_3&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Libraries\Documents\My Documents\Research_5_3&amp;quot; or &amp;quot;Desktop\[User]\My Documents\BESA\Research_5_3.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir%'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows Vista (English):'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%localapp%''' = &amp;quot;C:\Users\[user]\AppData\Local\BESA\Research_5_3&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Desktop\[user]\AppData\Local\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%publicprog%''' = &amp;quot;C:\Users\Public\Public Documents\BESA\Research_5_3&amp;quot;. This folder is directly accessible from the Windows Explorer under &amp;quot;Desktop\Public\Public Documents\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;C:\Users\[user]\Documents\BESA\Research_5_3&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Desktop\[user]\Documents\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as''' %progdir% &amp;amp;nbsp;'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows XP (English):'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%localapp%''' = &amp;quot;C:\Documents and Settings\[user]\Local Settings\Application Data\BESA\Research_5_3&amp;quot;, where [user] is the logon name of the current user.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%publicprog%''' = &amp;quot;C:\Documents and Settings\All Users\Documents\BESA\Research_5_3&amp;quot;. This folder is directly accessible from the Windows Explorer under &amp;quot;Desktop\Shared Documents\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;C:\Documents and Settings\[user]\My Documents\BESA\Research_5_3&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Desktop\My Documents\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as '''%progdir%''' &amp;amp;nbsp;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows 2000 (English):'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%localapp%''' = &amp;quot;C:\Documents and Settings\[user]\Local Settings\Application Data\BESA\Research_5_3&amp;quot;, where [user] is the logon name of the current user.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%publicprog%''' = &amp;quot;C:\Documents and Settings\All Users\Documents\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%privateprog%''' = &amp;quot;C:\Documents and Settings\[user]\My Documents\BESA\Research_5_3&amp;quot;, where [user] is the logon name of the current user. This folder is directly accessible from the Windows Explorer as &amp;quot;Desktop\My Documents\BESA\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%progdir%''' = the BESA Research root folder. In a default installation, this is &amp;quot;C:\Program Files\BESA\\Research_5_3&amp;quot;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''%besaroot%''' is the same as '''%progdir%'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Batch Commands ===&lt;br /&gt;
&lt;br /&gt;
Batch commands are selected when the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt;&amp;quot; button is pressed in the Batch Tab. The commands are subdivided into five categories: General commands, commands for the Main module, for the Source Analysis module, imaging commands in the Source Analysis module, and commands for Time-Frequency Analysis. The commands have prefixes,''' GEN''', '''MAIN''',''' SA''', '''SAIMAGE''', and''' TFC'''), which identify the category. For compatibility with older program versions, old batches without the prefixes are accepted.&lt;br /&gt;
&lt;br /&gt;
Detailed descriptions of each batch command are available in the electronic help chapter “''Batch Processing and Combining Conditions / Batch Processing / Batch Commands”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands''' - prefixed with &amp;quot;'''GEN'''&amp;quot; (can be used anywhere):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
|GENBatchError || used to change program behavior when errors occur&lt;br /&gt;
|-&lt;br /&gt;
|GENComment || comment in the batch script: no batch functionality&lt;br /&gt;
|-&lt;br /&gt;
|GENMATLABcommand || send a command string to Matlab&lt;br /&gt;
|-&lt;br /&gt;
|GENMATLABwaitForVariable || tells BESA to wait until Matlab has created a variable with the specified name.&lt;br /&gt;
|-&lt;br /&gt;
|GENPause || pause batch operations, allowing step-by-step operations&lt;br /&gt;
|-&lt;br /&gt;
|GENFor/GENEndFor|| a programming language-like FOR loop&lt;br /&gt;
|-&lt;br /&gt;
|GENRunProcess || runs a command line process, e.g. an external program to perform part of the data analysis in the batch&lt;br /&gt;
|-&lt;br /&gt;
|GENWindowPosition || set window size and positions to a selection of standard settings, e.g. for bitmap export&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for the Main Module''' - prefixed with &amp;quot;'''MAIN'''&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| MAINArtifactCorrect || run automatic artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactMethod || specify the method for artifact correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifactOn || turn artifact correction an artifact view on or off&lt;br /&gt;
|-&lt;br /&gt;
| MAINArtifact Scan || run an artifact scan as from the Paradigm Dialog&lt;br /&gt;
|-&lt;br /&gt;
| MAINAuxiliaryFiles || associate auxiliary files (e.g. *.''ela'', *.''sfp'') with the data file&lt;br /&gt;
|-&lt;br /&gt;
| MAINAverage || average the data&lt;br /&gt;
|-&lt;br /&gt;
| MAINBaseline || specify the parameters for baseline correction&lt;br /&gt;
|-&lt;br /&gt;
| MAINEditDefaultEpoch || edit the default block epoch&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventRead || read events from an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINEventWrite || write events to an ASCII event file&lt;br /&gt;
|-&lt;br /&gt;
| MAINExport || export or append data in the selected target format&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFT || calculates the FFT spectrum of the marked data interval&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTmean || starts an averaging procedure which calculates the mean spectral properties in pre-defined regions&lt;br /&gt;
|-&lt;br /&gt;
| MAINFFTsave || saves FFT data (generated using the ''FFT Average option'' in the ''Average ''command) to disk (*.''fma)''&lt;br /&gt;
|-&lt;br /&gt;
| MAINFileOpen || close the current file and open a new file to which the remaining batch commands will be applied&lt;br /&gt;
|-&lt;br /&gt;
| MAINFilter || set filters&lt;br /&gt;
|-&lt;br /&gt;
| MAINfMRIArtifact || turns on the fMRI artifact removal&lt;br /&gt;
|-&lt;br /&gt;
| MAINGoTo || jumps with the cursor to the specified time point&lt;br /&gt;
|-&lt;br /&gt;
| MAINICA || starts ICA decomposition of data on the current screen &lt;br /&gt;
|-&lt;br /&gt;
| MAINICAsave || saves selected ICA components as topographies in a file&lt;br /&gt;
|-&lt;br /&gt;
| MAINICAselect || opens component selection dialog for managing ICA components&lt;br /&gt;
|-&lt;br /&gt;
| MAINImportASCII || import an ASCII file into a ''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'' file.&lt;br /&gt;
|-&lt;br /&gt;
| MAINMarkBlock || mark a data block (optionally send to Source Analysis)&lt;br /&gt;
|-&lt;br /&gt;
| MarkChannels || mark one or more channels, as given by the list&lt;br /&gt;
|-&lt;br /&gt;
| MAINMaxInInterval || within the current marked block, search for the largest absolute value on the specified channel&lt;br /&gt;
|- &lt;br /&gt;
| MAINMontage || change the montage (used by the Export command when saving to current montage)&lt;br /&gt;
|-&lt;br /&gt;
| MAINParadigm || load a paradigm file&lt;br /&gt;
|-&lt;br /&gt;
| MAINPatternToTrigger || convert a tag into a trigger&lt;br /&gt;
|-&lt;br /&gt;
| MAINPolygraphicFilters || sets filters for polygraphic or added channels&lt;br /&gt;
|-&lt;br /&gt;
| MAINScale || set amplitude and time scales&lt;br /&gt;
|-&lt;br /&gt;
| MAINSearchAverageView || start search average view&lt;br /&gt;
|-&lt;br /&gt;
| MAINSendToMATLAB || send data to MATLAB&lt;br /&gt;
|-&lt;br /&gt;
| MAINTriggerSelect || edit the trigger list (cf. ''Edit / Trigger Values''...)&lt;br /&gt;
|-&lt;br /&gt;
| MAINTriggerTagDelete || delete one or more triggers or tags&lt;br /&gt;
|-&lt;br /&gt;
| MainViewAverageBuffer || turn on the Average Buffer View and place the specified buffer number to the left in the display&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''General commands for Source Analysis''' - prefixed with &amp;quot;'''SA'''&amp;quot; (but see also ''MarkBlock'', which is used to send a block of data to SA and open the SA window):&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| SAAddSource || add a dipole or regional source to a model&lt;br /&gt;
|-&lt;br /&gt;
| SAChannelTypeForFit || switch between EEG, magnetometers or axial gradiometers, and planar gradiometers&lt;br /&gt;
|-&lt;br /&gt;
| SAConvertSource || convert a source from dipole to regional source, or from regional source to dipole&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalClara || run Cortical CLARA&lt;br /&gt;
|-&lt;br /&gt;
| SAcorticalLoreta || run Cortical LORETA&lt;br /&gt;
|-&lt;br /&gt;
| SADelete || delete current solution or all solutions, or remove current fit interval or cursor&lt;br /&gt;
|-&lt;br /&gt;
| SADICS || start DICS computation (if DICS has been precomputed in the time-frequency image command)&lt;br /&gt;
|-&lt;br /&gt;
| SADisplayMRI || switch MRI display on/off and select small or large window&lt;br /&gt;
|-&lt;br /&gt;
| SAElectrodeConfiguration || equivalent to pressing the Org or Std button in the Channel box of the Source analysis window&lt;br /&gt;
|-&lt;br /&gt;
| SAExit || close Source Module&lt;br /&gt;
|-&lt;br /&gt;
| SAFit || start fit&lt;br /&gt;
|-&lt;br /&gt;
| SAFitConstraint || set fit constraints, e.g. Residual Variance, Energy, Maximum Distance, Image Weighting, and their weights.&lt;br /&gt;
|-&lt;br /&gt;
| SAFitInterval || set fit or baseline interval&lt;br /&gt;
|-&lt;br /&gt;
| SAMinimumNorm || run a minimum norm analysis&lt;br /&gt;
|-&lt;br /&gt;
| SANewSolution || open a new solution&lt;br /&gt;
|-&lt;br /&gt;
| SAOpenSolution || open a solution from a file&lt;br /&gt;
|-&lt;br /&gt;
| SAPCA || toggle PCA display of data or residual, and transfer a selected number of components to the source model&lt;br /&gt;
|-&lt;br /&gt;
| SARegularization || set the regularization values both for discrete and distributed source images&lt;br /&gt;
|-&lt;br /&gt;
| SASaveBitmap || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| SASaveLeadfields || save the leadfields of the current source model&lt;br /&gt;
|-&lt;br /&gt;
| SASaveModelWaveforms || save model waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveResidualWaveforms || save residual waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveRVandGFPWaveforms || save residual variance and global field power waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSolution || save the current solution&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceMontage || save a source montage&lt;br /&gt;
|-&lt;br /&gt;
| SASaveSourceWaveforms || save source waveforms&lt;br /&gt;
|-&lt;br /&gt;
| SASendToMATLAB || send data, model, source waveforms, images, etc. to Matlab&lt;br /&gt;
|-&lt;br /&gt;
| SASetCursor || set the cursor&lt;br /&gt;
|-&lt;br /&gt;
| SASetDefaultSourceType || set the default source type (dipole or regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrActivateSource || Turn specified source on or off, or enable/disable source for fitting&lt;br /&gt;
|-&lt;br /&gt;
| SASetOrientation || set orientation (of regional source)&lt;br /&gt;
|-&lt;br /&gt;
| SASwitchCondition || switch to a specified condition&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Distributed 3D Volume Images'''&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| SAIMAGEBeamformer || switch between Single Source and Bilateral Beamformer image&lt;br /&gt;
|-&lt;br /&gt;
| SAimageBrainAtlas || turns on the Brain Atlas overlay on volumetric image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGECLARA || generate CLARA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEExport || save the results of minimum norm or 3D imaging method&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEGotoMax || set the crosshair cursor at the nth maximum in the image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEImport || load a 3D volume image from file&lt;br /&gt;
|-&lt;br /&gt;
| SAimageImportFMRI || import fMRI image to Source Analysis Module&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELAURA || create LAURA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGELORETA || create LORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESLoreta || create sLORETA image&lt;br /&gt;
|-&lt;br /&gt;
| SAimageSESAME || start SESAME computation&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESSLOFO || create SSLOFO image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEUser-Defined || create user-defined image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESaveLeadfields || save the leadfields of all the voxel sources in a 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGEClip || clip current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESmooth || smooth current 3D image&lt;br /&gt;
|-&lt;br /&gt;
| SAIMAGESetCrosshair || set the position of the crosshair in the 3D image&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Commands for Time-Frequency Analysis''' ('''TFC''')&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot;&lt;br /&gt;
| TFCStartTFAnalysis ||(previously TFCgo) start TFC analysis using the current paradigm settings&lt;br /&gt;
|-&lt;br /&gt;
| TFCdisplay || change the TFC display (e.g. power/amplitude, coherence)&lt;br /&gt;
|-&lt;br /&gt;
| TFCsave || save numerical results to an ASCII file, or save a screenshot of the TFC window&lt;br /&gt;
|-&lt;br /&gt;
| TFCimage || start beamformer analysis on a selected time-frequency range&lt;br /&gt;
|-&lt;br /&gt;
| TFCSendToMATLAB || send TF results or single-trial data to MATLAB&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How to Average Your Data in a Batch  ===&lt;br /&gt;
&lt;br /&gt;
Using batch processing, several files from an experiment can be averaged at a time.&lt;br /&gt;
&lt;br /&gt;
Here we summarize the steps required:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Create the paradigm, and save the paradigm file.&lt;br /&gt;
* Open each individual data file to check the data:&lt;br /&gt;
** Make sure auxiliary files are defined and loaded properly, and the data are displayed correctly.&lt;br /&gt;
** Eyeball the data.&lt;br /&gt;
** Define bad (and interpolated) channels.&lt;br /&gt;
** Mark artifact time ranges.&lt;br /&gt;
** If required, set up artifact correction for the file.&lt;br /&gt;
** The data file can be closed again after this step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Preparing the batch'''&lt;br /&gt;
&lt;br /&gt;
* Open at least one&amp;amp;nbsp;file and select ''Process / Batch Scripts''.... The file(s) should be displayed in the file list. Alternatively, just select ''Process / Batch Scripts...,'' and add the files by&lt;br /&gt;
** pressing the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** dragging the files from Windows Explorer&lt;br /&gt;
** Opening a previously saved&amp;amp;nbsp;list with ''Load File List''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* You can delete files from the list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt;) or edit the file sequence using the right click context menu.&lt;br /&gt;
* Select the ''Batch Tab''.&lt;br /&gt;
* Add commands to your script. For averaging, these would normally be&lt;br /&gt;
** '''Paradigm''' -- to load the paradigm file&lt;br /&gt;
** '''Artifact Scan''' -- to run the artifact scan&lt;br /&gt;
** '''Average''' -- to perform the average&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Save these commands (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Test the commands on the files in the current file list: press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Look at the log file (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log File'''&amp;lt;/span&amp;gt;) to check the results of averaging.&lt;br /&gt;
* Look at the data averages to make sure they have been done correctly.&lt;br /&gt;
* Repeat these steps until averaging is working properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Running the batch'''&lt;br /&gt;
&lt;br /&gt;
* Select ''Process / Batch Scripts''....&lt;br /&gt;
* Open the files you want to average in the batch in the file list:&lt;br /&gt;
** Any files that were open in BESA are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Edit the file list, e.g. delete unwanted files (use the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; key or the right click context menu), or reorder the files (use &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl + cursor keys'''&amp;lt;/span&amp;gt; or context menu).&lt;br /&gt;
* Note that the order of files in the list specifies the order in which they will be processed in the batch script. This order will be important if all results are saved to the same target file. Otherwise the file sequence is not important.&lt;br /&gt;
* Optionally, save the file list (press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;&lt;br /&gt;
* Select the ''Batch Tab'', and load the previously defined batch script with ''Load Batch''.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch.&lt;br /&gt;
&lt;br /&gt;
=== How to Merge and Compress raw data  ===&lt;br /&gt;
&lt;br /&gt;
Using the Export command in a batch, several data files can be merged into a single data file in BESA's data format (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.foc&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This can be useful if data from one subject have been collected in several data blocks, and you want to analyze all data blocks together.&lt;br /&gt;
&lt;br /&gt;
Optionally, to save space, data can be saved in compressed format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Files can be merged:'''&lt;br /&gt;
&lt;br /&gt;
* if they have identical channel configurations, or&lt;br /&gt;
* there are at least 16 EEG channels, and the export format is Standard 81 (i.e. EEG channels are interpolated to 81 standard locations). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''How to merge files:'''&lt;br /&gt;
&lt;br /&gt;
* Select '''Process / Batch Scripts...'''&lt;br /&gt;
* Add all the files that are to be merged to the file list:&lt;br /&gt;
** Any files that were open in BESA Research are included in the list&lt;br /&gt;
** Files can be added using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
** You may drag one or more files from Windows Explorer to the file list&lt;br /&gt;
** Alternatively, load a previously saved file list (''Load File List'').&lt;br /&gt;
* Rearrange the files in the file list to the sequence in which they should be merged.&lt;br /&gt;
* Select the ''Batch Tab ''and insert an &amp;quot;''Export&amp;quot;'' command, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following dialog shows a possible configuration of the ''Export'' command:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (4).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The parameters shown in the Information box are the settings chosen in the ''Export Dialog'' when the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt; button has been pressed.&lt;br /&gt;
* '''Append if file already exists''' must be checked in order to merge the files.&lt;br /&gt;
* The '''target file name''' must be fixed, i.e. don't use the '''%basename%''' variable, because that will result in a different target file name for each source file.&lt;br /&gt;
* There are two variables that can be used for the segment label:&lt;br /&gt;
** '''%filename%''' will insert the basename of the source file into the segment label.&lt;br /&gt;
** '''%c%''' will insert the file number into the segment label. The number gives&amp;amp;nbsp;the position of the file in the file list. For instance, &amp;quot;File %c%&amp;quot; will generate the label &amp;quot;File 2&amp;quot; for the second file in the list.&lt;br /&gt;
&lt;br /&gt;
=== Example: Data averaging in the auditory intensity experiment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, two raw data files, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;, from the auditory intensity experiment will be batch averaged.&lt;br /&gt;
&lt;br /&gt;
Please note that there are further tutorials covering this experiment. The first file is contaminated by many eyeblinks, and more epochs would be averaged if eye correction were used (see Viewlet demonstration on artifact correction on the BESA website). However, in this tutorial we will just use artifact rejection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Various ways of creating a File List'''&lt;br /&gt;
&lt;br /&gt;
1. '''Files that were open in BESA Research are automatically added to the File List.''' Start BESA Research and open the files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt '''&amp;lt;/span&amp;gt;in the directory ''Examples\ERP-Auditory-Intensity''.&lt;br /&gt;
&lt;br /&gt;
2. Select ''Process / Batch Scripts''.... You should see the file names in the '''''File List Tab''''' something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (5).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. You can resort the files in the file list alphabetically by clicking onto the '''''File List column header''''':&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can mark any file, hold down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl '''&amp;lt;/span&amp;gt;key and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Up'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Down arrow '''&amp;lt;/span&amp;gt;to move the file name up or down the list. This is the sequence in which files will be processed in the batch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save File List'''&amp;lt;/span&amp;gt; and save the list you have created to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Highlight both names and press the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
6. '''Files can be dragged from Windows Explorer'''. Start Windows Explorer and navigate to the ''ERP-Auditory-Intensity'' subdirectory of your BESA Research examples folder (located in the ''Public Documents'' folder of your computer). Click on &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt; and drag it with the mouse onto the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''''File List Tab'''''. Let go of the mouse. BESA Research opens the file, and displays the name in the File List. Repeat for &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt.'''&lt;br /&gt;
&lt;br /&gt;
7. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del '''&amp;lt;/span&amp;gt;button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
8. '''Files can be added using the ''Add File'' button'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add File'''&amp;lt;/span&amp;gt; and navigate to the ''Examples\ERP-Auditory-Intensity'' subdirectory. Select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1.cnt'''&amp;lt;/span&amp;gt;. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl'''&amp;lt;/span&amp;gt; and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2.cnt'''&amp;lt;/span&amp;gt;. Both names should then be displayed in the ''File Open'' dialog. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to add the files to the file list.&lt;br /&gt;
&lt;br /&gt;
9. Highlight both names and press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Del'''&amp;lt;/span&amp;gt; button to remove them from the list.&lt;br /&gt;
&lt;br /&gt;
10. '''Files can be loaded from a previously saved file list'''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load File List '''&amp;lt;/span&amp;gt;and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-Ex1.flist'''&amp;lt;/span&amp;gt;, the list you saved in step 6 above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Setting up the batch'''&lt;br /&gt;
&lt;br /&gt;
1. We will add three commands, '''Paradigm''', '''Artifact Scan''', and '''Average''', to create a batch that will be applied to the two files in the file list.&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''Batch Tab'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button to obtain the ''Select Command'' window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (9).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt; and then on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; (alternatively, double-click on &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Paradigm'''&amp;lt;/span&amp;gt;). Hit &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Browse'''&amp;lt;/span&amp;gt;, navigate to the ''Auditory'' folder, and select &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''AEP_Intensity.pdg'''&amp;lt;/span&amp;gt;, the paradigm for the auditory intensity experiment.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (10).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to obtain the ''Load Paradigm Task'' window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (11).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;, and the first task in the batch is ready, and listed in the Batch Command window. If you want to modify the command, double-click on it to open the above window, that allows to browse for a different paradigm file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (12).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Next, we add the '''Artifact Scan''' command. Click on the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select ''Artifact Scan.''&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (13).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Artifact Scan Task'' window. We want to be able to view the results of the scan, and adjust thresholds and bad channels if necessary. Therefore, check the ''Wait after scan'' checkbox.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (14).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to close the ''Artifact Scan Task'' window. Our batch now contains two commands.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (15).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Finally, we will add an '''Average''' command. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button and select ''Average''. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Average Task ''window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (16).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. With the default settings, the average would be saved to the same directory as the data. The file name mask is set by default so that in this example the two averages would be saved to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1-av.fsg '''&amp;lt;/span&amp;gt;and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s2-av.fsg'''&amp;lt;/span&amp;gt;. We will save the averaged files to subdirectory ''&amp;quot;Averages''&amp;quot; of the data directory. Uncheck the ''Use default target'' check box, change the File name mask to '''%basename%_av-test''' in order not to overwrite the predefined files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (17).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Average Task'' window. Our batch is now complete.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (18).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
13. We will now save the batch so that it can be used again. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt; button, and save to the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ERP-Aud-ex1.bbat'''&amp;lt;/span&amp;gt;. Note that an easy way to generate new averaging batches is to load a previously save batch and edit the commands -- it may only be necessary to edit the '''Paradigm''' command to select the relevant paradigm file, and maybe to adjust the target directory in the '''Average''' command.&lt;br /&gt;
&lt;br /&gt;
14. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch'' Window to start the batch running. As requested, the batch pauses after the artifact scan:. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (19).gif]]&lt;br /&gt;
&lt;br /&gt;
You may now adjust the number of rejected trials, e.g. by moving the vertical red bar to the left, or exclude bad channels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to continue with averaging.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (20).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
16. Note that, in the background, the ''Batch Running'' window is providing feedback about the current file and current task.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (6).jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
17. The batch will stop again after the next artifact scan. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to allow the batch to run to the end.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (21).gif|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
18. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''View Log'''&amp;lt;/span&amp;gt; to view the batch protocol. If you are using Internet Explorer or Netscape family (Mozilla, Firefox) browsers, and JavaScript is enabled, you will first see just batch titles defined by the date and time the batch was started. The most recent title is at the top of the list. For other browsers, or if JavaScript was not enabled, all protocol texts are expanded as in 19 (below).&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (22).gif|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
19. Click on the first title to expand its protocol. Here, for example, the protocol gives feedback about the number of epochs that were averaged for each file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (23).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
20. Finally, press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to return to the main BESA Research display. Open the averages in the ''Averages'' subdirectory to confirm that they were generated properly.&lt;br /&gt;
&lt;br /&gt;
=== Example: Merging files using the Export Command ===&lt;br /&gt;
&lt;br /&gt;
Here we will demonstrate the use of the '''Export '''command to merge two files. We will combine the two averages from the previous example (Data averaging in the auditory intensity experiment) into one target file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. Generate the file list'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and load the two data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av-test.fsg'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2_av-test.fsg'''&amp;lt;/span&amp;gt; that were saved in the previous example.&lt;br /&gt;
# Select ''Process / Batch Scripts....''The two file names should be displayed in the file list.&lt;br /&gt;
# In the file list, make sure that &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''s1_av-test.fsg '''&amp;lt;/span&amp;gt;is the first file in the list. If it is not, highlight the file, and move it up using &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Ctrl+up'''&amp;lt;/span&amp;gt;, or right click and select ''Move Up'' in the context menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Generate the batch'''&lt;br /&gt;
&lt;br /&gt;
1. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Add Command'''&amp;lt;/span&amp;gt; button, and select the '''Export''' command.&lt;br /&gt;
&lt;br /&gt;
2. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to open the ''Export Task'' window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (24).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Select Options'''&amp;lt;/span&amp;gt;... button to open the ''Export Dialog''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (25).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Since we are combining averages, select ''Hires (no compression)'' in the '''Target data format''' drop-down list (If we were merging raw data files, it is better to select compression. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the dialog. Check'' Append if file already exists'', so that the files will be merged. Enter '''s1+s2''' in the target file name mask edit box. This ensures that both files will be saved to the same target: &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (26).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK '''&amp;lt;/span&amp;gt;to close the ''Export Task'' window. The '''Export '''command is displayed. &amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (27).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Optionally, you may save the batch file by pressing &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Batch'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
7. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; to run the batch, and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt; in the ''Batch Completed'' window to return to the BESA main window.&lt;br /&gt;
&lt;br /&gt;
8. Finally, open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.fsg'''&amp;lt;/span&amp;gt; to confirm that it contains the two merged files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Merge raw data'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Repeat the above task to merge the two raw data files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1.cnt'''&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S2.cnt'''&amp;lt;/span&amp;gt; into a single target file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1+S2.foc'''&amp;lt;/span&amp;gt;. In this case, select one of the compression options as the target data format. Note that you would not normally want to merge two files from different subjects. However, several data blocks from the same subject can conveniently be merged using this method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note that &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; files can also be merged using the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;''Combine Conditions''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt; dialog. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Combine Conditions, Channels ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Combine Condition Scripts ===&lt;br /&gt;
&lt;br /&gt;
With the Combine-Conditions module you can do a variety of operations on BESA averages (files with the extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.fsg&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, and other segment files, such as &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.mul&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.avr&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''&amp;lt;nowiki&amp;gt;*.swf&amp;lt;/nowiki&amp;gt;'''&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* Create grand averages&lt;br /&gt;
* Combine averages (add, subtract, weighted/unweighted)&lt;br /&gt;
* Merge files&lt;br /&gt;
* Exclude unwanted averages&lt;br /&gt;
* Rename conditions&lt;br /&gt;
* Rename or resort channels&lt;br /&gt;
* Generate averages or differences over selected channels&lt;br /&gt;
* Transform the data: standard interpolated 81 electrodes, change sampling rate, change interval&lt;br /&gt;
* Determine peaks, mean amplitudes, or integrals on data averages&lt;br /&gt;
* These operations can be performed on one or more files simultaneously. Results of an operation are stored in a single target file.&lt;br /&gt;
&lt;br /&gt;
The module includes four tabbed windows:&lt;br /&gt;
&lt;br /&gt;
* File List: Define a list of files on which the operations will be performed.&lt;br /&gt;
* Condition List: List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
* Channel List: List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
* Run Scripts: Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak analysis). Start the operation.&lt;br /&gt;
* Note that in all four tabs, configurations can be saved for future use, and the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button restores the most recently used configuration.&lt;br /&gt;
&lt;br /&gt;
=== Condition List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the condition names, define target condition names, and how input conditions are combined into target conditions.&lt;br /&gt;
&lt;br /&gt;
The first column of the&amp;amp;nbsp;list box shows a list of all the condition names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the source conditions. Columns define the target conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each condition name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target conditions will have the same name as source conditions. Right click on source condition labels to view properties (e.g. no. of samples, time range, sampling rate).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (28).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the condition list'''&lt;br /&gt;
&lt;br /&gt;
* Target condition names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: conditions can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over conditions, the sum is divided by the number of conditions, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;''Divide result by sum of PLUS factors''&amp;quot; is unchecked, the conditions will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between conditions, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the condition list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Weighting of averages'''&lt;br /&gt;
&lt;br /&gt;
* Below the list, click on the ''Weighted Average'' row to toggle &amp;quot;YES&amp;quot; and &amp;quot;NO&amp;quot;. &amp;quot;YES&amp;quot; means that averages will be weighted by the number of epochs contributing to the average. For instance, if average A contained 100 epochs and average B contained 200 epochs, the weighted average will be computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(100 * A + &amp;amp;nbsp;200 * B) / (100 + 200)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Select &amp;quot;NO&amp;quot; for an unweighted average. For the above example, the average is computed as&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;(A + B) / 2&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1cm;margin-right:0cm;&amp;quot;&amp;gt;Weighted averages are not permitted if one of the boxes contains a negative value.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Values other than +1 or -1 in the boxes apply a different kind of weighting. For instance, we want to compute the difference between the means of conditions A, B, C and D, E. Use a right click to specify the fraction 1/3 for each of A, B, and C, and -1/2 for each of D and E (see example below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (29).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a condition list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Feedback'''&lt;br /&gt;
&lt;br /&gt;
* Conditions that have different numbers of electrodes (averaging across different files) can only be combined if channels are interpolated to a standard set of electrodes.&lt;br /&gt;
* Conditions that have different durations or sampling rates can only be combined if the sampling rate and durations are made the same.&lt;br /&gt;
* Feedback about the above situations is displayed by the presence of tick marks above the list box.&lt;br /&gt;
&lt;br /&gt;
=== Channel List Tab ===&lt;br /&gt;
&lt;br /&gt;
List the channel names, define target channel names, and how input channels are combined into target channels.&lt;br /&gt;
&lt;br /&gt;
Note that this tab is very similar in usage to the '''Condition List Tab'''. Note also that some of the functions performed in this tab could also be done in the Montage Editor. It may be a matter of convenience whether you choose to perform these operations here or in the Montage Editor.&lt;br /&gt;
&lt;br /&gt;
The first column of the list box shows a list of all the channel names found in the source files.&lt;br /&gt;
&lt;br /&gt;
Rows of the list box define the ''source'' channel. Columns define the'' target'' channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Initial setting'''&lt;br /&gt;
&lt;br /&gt;
When first selecting the tab, each column shows each channel name found in the source files (as in the example below). In the list box, there is a &amp;quot;+1&amp;quot; along the diagonal. The result of this selection is that target channel will have the same name as source channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Combining files'''&lt;br /&gt;
&lt;br /&gt;
If files with different channel configurations are included in the File List, the rows and columns of the Channel List Tab will only contain the labels for the channels that are in common among the files.&lt;br /&gt;
&lt;br /&gt;
If the files in the File List have a different sequence of channels, the sequence of the first file in the list will be adopted in the Channel List.&lt;br /&gt;
&lt;br /&gt;
Thus, for the initial setting, unless the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked, the target grand average or peak/amplitude analysis, etc. will be applied using only channels that are in common among the input files, and using the channel sequence of the first file in the File List. By changing the target channels or by changing the entries in the Channel List, new channels consisting of averages or differences can be generated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''What can the Channel List be used for?'''&lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
&lt;br /&gt;
* Reorder or relabel channels&lt;br /&gt;
* Create channel differences&lt;br /&gt;
* Create averages over channel groups, e.g. for peak analysis&lt;br /&gt;
* Extract a selection of channels for peak analysis or mean amplitudes&lt;br /&gt;
* Create grand averages across files with different channel configurations, just using channels in common among the files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (30).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Editing the channel list'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Target channel names can be edited, inserted or deleted by clicking on the label at the top of each column.&lt;br /&gt;
* Click on a box within the list to toggle between &amp;quot;+1&amp;quot;, &amp;quot;-1&amp;quot; and blank. These correspond to the operations:&lt;br /&gt;
** &amp;quot;+1&amp;quot; = add&lt;br /&gt;
** &amp;quot;-1&amp;quot; = subtract&lt;br /&gt;
** blank = do nothing&lt;br /&gt;
* Right click on a box for further operations: channels can be weighted by a given factor other than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Divide result by sum of PLUS factors'''&lt;br /&gt;
&lt;br /&gt;
* Normally, when creating an average over channels, the sum is divided by the number of channels, or a weighted average is generated (see below). &amp;amp;nbsp;If &amp;quot;Divide result by sum of PLUS factors&amp;quot; is unchecked, the channels will be summed rather than averaged.&lt;br /&gt;
* Note that, when making differences between channels, no such division is required. BESA Research will uncheck the checkbox automatically if subtraction (&amp;quot;-1&amp;quot;) is specified somewhere in the channel list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save the current channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Channel List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load a channel list'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Channel List&amp;amp;nbsp;'''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load previous settings'''&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Previous'''&amp;lt;/span&amp;gt; button&lt;br /&gt;
&lt;br /&gt;
=== Run Scripts Tab ===&lt;br /&gt;
&lt;br /&gt;
Define global options for the output (e.g. spatial interpolation, resampling, copy/merge or average, peak detection. Start the operation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (7).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load or Save Settings'''&lt;br /&gt;
&lt;br /&gt;
* You can save the current settings of this tab to a file (*.run) which can be loaded later.&lt;br /&gt;
* When you run the script, the current settings are saved automatically to a file &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Load Previous'''&lt;br /&gt;
&lt;br /&gt;
* Press this button to load the previous settings (from &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''PreviousSettings.run'''&amp;lt;/span&amp;gt;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Averages to Generate'''&lt;br /&gt;
&lt;br /&gt;
* '''Generate separate averages for each source file'''. Averages are performed over conditions within the source file, and are then appended to the target file.&lt;br /&gt;
* '''Combine data from source files'''. Conditions are combined over all source files into a single target average.&lt;br /&gt;
* '''No averages, just copy'''. Files are copied and merged to the target file. Use this option for renaming conditions, merging files, removing unwanted averages (see below), changing the sampling rate and interval.&lt;br /&gt;
* '''Peaks and mean amplitudes'''. Specify time ranges for peaks, mean amplitudes, or integrals (areas).&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;Note: When generating or copying averages (first three options), filters and baseline settings are turned off. For Peaks and mean amplitudes, filters and baseline settings are specified in the dialog.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Spatial Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Interpolate to Standard 81 electrodes'''. The target file will contain only electrodes (other channels are omitted), using the Standard 81 configuration (as in other export functions within BESA Research). This cannot be selected if the source data contain less than 16 EEG channels.&lt;br /&gt;
* '''Interpolate Bad Channels'''. Bad electrode channels in the source file will be interpolated. If the above option is deselected and bad channels exist in one or more of the source files, this option is always on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;BESA Research can interpolate EEG, and MEG if the sensors are axial gradiometers or magnetometers. If other channels are marked as bad in one or more of the source files, these will be defined as bad in the target file. This applies to MEG planar gradiometers, to polygraphic data, and to ICR channels.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Temporal Interpolation'''&lt;br /&gt;
&lt;br /&gt;
* '''Spline to New Sampling Rate and Interval'''. Data can be converted to a new sampling rate, and the interval can be changed.&lt;br /&gt;
** If the sampling rate is reduced, the data will be low-pass filtered at 1/3 sampling frequency before reduction.&lt;br /&gt;
** If the sampling interval is changed, the prestimulus and poststimulus intervals are limited by the smallest intervals in the conditions contributing to the averages. These limits are shown below the edit boxes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks and Mean Amplitudes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (31).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Peaks:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range between which peaks are to be determined.&lt;br /&gt;
* Select the montage on which the peaks are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Define the baseline settings.&lt;br /&gt;
* Specify whether peaks are to be defined at one latency: if so, select the channel on which peaks are to be detected.&lt;br /&gt;
* Specify whether you want to find positive or negative peaks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Mean amplitudes and areas:'''&lt;br /&gt;
&lt;br /&gt;
* Select the time range over which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Select the montage on which the mean amplitudes or areas are to be determined.&lt;br /&gt;
* Define the filter settings.&lt;br /&gt;
* Note that when computing areas, data are first rectified (made positive) and then summed over the time range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Output options of the analysis:'''&lt;br /&gt;
&lt;br /&gt;
* A single ASCII file that contains the result of the analysis for all data sets, conditions, and channels including header and information lines.&lt;br /&gt;
* A sparse output suitable for import in SPSS. Each variable (e.g. a latency, a channel amplitude) constitutes one column of the output file.&lt;br /&gt;
* Direct transfer to MATLAB into a struct besa_peak. For more information on the data transfer from BESA Research to MATLAB, please refer to help chapter ''“The MATLAB interface”.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Starting the Operation'''&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;amp;nbsp;to start the operation. After the operation is completed, and the &amp;quot;Open target file in BESA&amp;quot; box is checked, BESA Research will open the target file. &amp;amp;nbsp;&amp;quot;Open target file in BESA&amp;quot; cannot be checked if &amp;quot;Peaks and mean amplitudes&amp;quot; was selected - then the result of the operation will be an ASCII file or a MATLAB transfer.&lt;br /&gt;
* You will be asked for the name of the target file (unless a MATLAB transfer of peak data has been performed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Restrictions'''&lt;br /&gt;
&lt;br /&gt;
* Depending on source file configurations, not all options above are selectable. For instance, if two files contain different numbers of electrodes, and the &amp;quot;''Ignore Settings in this Tab''&amp;quot; checkbox is checked in the '''''Channel List''''' Tab, spatial interpolation to Standard 81 is enforced in the target. Similarly, if different sampling rates are used in different files, temporal interpolation is enforced.&lt;br /&gt;
* You are not allowed to add files to the file list if the channel configuration is different, and the data cannot be combined with Standard 81 interpolation. Since Standard 81 interpolation is only possible for EEG, multiple files without EEG can only be loaded if they have the same number of channels.&lt;br /&gt;
&lt;br /&gt;
=== How to Create Grand Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to average in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To average across different conditions, click in the list boxes to obtain &amp;quot;+1&amp;quot; for each source condition to combine, and rename the target condition to define a meaningful name for the average.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Generate Differences Between Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. To create differences, click in the list boxes to obtain &amp;quot;+1&amp;quot; for one of the source conditions, and &amp;quot;-1&amp;quot; for the source condition to subtract, and rename the target condition to define a meaningful name for the difference.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''.&lt;br /&gt;
* If you have more than one file, specify whether averages should be generated across files ('''Combine data from source files''') or within files ('''Generate separate averages for each source file''').&lt;br /&gt;
* Select other options if required (spatial or temporal resampling).&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. An average of the differences is generated. If only one example of each condition exists, e.g. in a grand average file, the result is the difference between conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Merge Files ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the files you want to merge in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notes'''&lt;br /&gt;
&lt;br /&gt;
* If the source files have different electrode configurations, use the Standard 81 configuration for the target.&lt;br /&gt;
* If the source files have different sampling rates or intervals, use Temporal Interpolation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Remove Unwanted Averages ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted segments'''&lt;br /&gt;
&lt;br /&gt;
* Normally, all conditions are read from a source file. To exclude one or more segments from operations in the Combine Conditions module, mark the segments as artifacts in the main program display. It is sufficient for the beginning or the end of an artifact interval to be within the segment for the segment to be excluded.&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as averages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removing one or more unwanted conditions (by label)'''&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...).''&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Deselect the target conditions you want to omit (replace the &amp;quot;+1&amp;quot; by a blank).&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data without the conditions that were marked as artifacts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Rename Conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file you want to operate on in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions''...).&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions. Click on column headings to rename the target conditions.&lt;br /&gt;
* Click on the''' Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The target file contains the copied data with the renamed conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Change the Sampling Rate ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Open the file(s) you want to change in BESA Research.&lt;br /&gt;
* Start the Combine Conditions Module (''ERP / Combine Conditions...'').&lt;br /&gt;
* Click on the '''Condition List Tab'''. By default, the target conditions receive the same name as the source conditions.&lt;br /&gt;
* Click on the '''Run Scripts Tab'''. Select &amp;quot;''No averages, just copy''&amp;quot;.&lt;br /&gt;
* Select &amp;quot;''Spline to New Sampling Rate and Interval''&amp;quot; and type the new sampling rate into the edit box.&lt;br /&gt;
* Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Create grand average and combinations of conditions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, we will generate a grand average of the results of the Auditory Intensity Experiment. The experiment includes averages from five different stimulus intensities. We will create a grand average over each intensity, but also include means over the two lowest and the two highest intensities, and the difference between these two combinations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open files &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''S1_av.fsg - S10_av.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The files contain the individual averaged data of the 10 subjects who participated in this study.&lt;br /&gt;
# Select ''ERP / Combine Conditions...'' The file list should display the two files, with feedback about the number of averages and conditions. 8 epochs are found. See the ''“Data averaging in the auditory intensity'' ''experiment”'' example for examples how to manipulate the file list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (32).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. The initial window defines target conditions with the same name as the source conditions. To generate the grand average over these conditions we could proceed without further changes to the '''Run Scripts Tab'''. However, we want to modify the condition list and create a condition that contains the grand averaged difference between the''' High''' and '''Low''' conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (8).jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Click on the '''All '''column label. In the resulting window, rename condition '''All''' to''' Difference'''. Then press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (33).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. The last column is now labeled '''Difference.''' Left-click twice onto the ‘'''+1’''' entry that links this condition to the '''All '''input condition. This will remove the link and leave the field blank. To define the ‘Difference’ condition as the average of ‘High’ minus ‘Low’ over subjects, left-click once into the field linking input '''High''' with target '''Difference''' to generate an entry ‘'''+1’''' in this field. Left-click twice into the field linking input '''Low '''with target '''Difference''' to generate an entry '-'''1'''’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;[[Image:Batch processing (35).gif]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Save Condition List'''&amp;lt;/span&amp;gt; and save the list to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''ER&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;P-aud-ex1.clist'''&amp;lt;/span&amp;gt;. This condition combination can thus be loaded later using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Load Condition List'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Click on the '''Run Script Tab'''.&lt;br /&gt;
# The default tab settings are ready for generating the grand average ('''Combine data from source file''' and '''Open target file in BESA''' should be checked). Just press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Enter &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_cc-test.fsg'''&amp;lt;/span&amp;gt; as file name and press&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Save'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The resulting file contains the 8 target conditions, 60db, 70dB, 80dB, 90dB, 100dB, Low, High, and Difference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: Average files from different experiments ===&lt;br /&gt;
&lt;br /&gt;
This example is intended to illustrate several features of the ''Combine Conditions'' Dialog, such as electrode interpolation and resampling. We will combine an average from the Auditory Intensity experiment with one from the P300 auditory experiment. In this particular case, it is not a very meaningful thing to do, but it shows what is possible. For instance, the same experiment may have been performed using different sampling rates or electrode combinations. This example shows how such data may be combined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A. File selection'''&lt;br /&gt;
&lt;br /&gt;
# Start BESA Research and open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''All_Subjects_GA.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-Auditory-Intensity'' folder. The file contains the grand average data from the auditory intensity experiment.&lt;br /&gt;
# Open the file &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''RareFrequentResponseLeft.fsg'''&amp;lt;/span&amp;gt; in the ''Examples\ERP-P300-Auditory'' folder. This file contains averages from the P300 auditory experiment.&lt;br /&gt;
# Select ''ERP / Combine Conditions... ''Note that the files have different sampling rates and different numbers of electrodes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (36).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''B. Define conditions'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Condition List Tab'''. Note that the feedback text at the bottom of the window displays the text &amp;quot;Standard 81 interpolation required to generate average; Across files: resampling or change in time range required to generate average&amp;quot;. The condition labels show all the names from both files.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (37).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.  We will exclude most conditions, and just combine the most similar conditions from the two experiments: the &amp;quot;Standard&amp;quot; and the &amp;quot;80dB&amp;quot; conditions. Click on the title of the first column,''' Blink'''. Select “''Delete all conditions to the right of this column”'', and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (38).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on the title again, and rename the target condition to &amp;quot;Standard&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (39).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click twice in the first line to remove the &amp;quot;+1&amp;quot; entry there. Click once in the third row (&amp;quot;Frequent&amp;quot;), and in the 7th row (&amp;quot;80dB&amp;quot;), to display &amp;quot;+1&amp;quot; at each entry. Thus, just two of the conditions will be combined into one target condition.&lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (40).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C. Run the script'''&lt;br /&gt;
&lt;br /&gt;
1. Click on the '''Run Script Tab'''. &lt;br /&gt;
&lt;br /&gt;
[[Image:Batch processing (41).gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Note that '''Interpolate to Standard 81 electrodes''' is checked and grayed: since two different electrode sets are to be combined, we can only do this by interpolating electrodes. Also, both '''Spline to new sampling rate''' and '''Clip interval '''are checked and grayed. Again, these settings are required in order to be able to average the two data files together. The sampling rate is set to the higher of the two selections. The time range is set to the largest possible range that can be clipped from the two data sets. For now, leave these settings as they are, and press &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;. Save the target to &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''TestCombineExpts_CC-std81.fsg'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=File:SA-Introduction_(5).gif</id>
		<title>File:SA-Introduction (5).gif</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=File:SA-Introduction_(5).gif"/>
				<updated>2021-05-04T12:30:10Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: Abinash uploaded a new version of &amp;amp;quot;File:SA-Introduction (5).gif&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=File:SA-Introduction_(3).gif</id>
		<title>File:SA-Introduction (3).gif</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=File:SA-Introduction_(3).gif"/>
				<updated>2021-05-04T12:29:03Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: Abinash uploaded a new version of &amp;amp;quot;File:SA-Introduction (3).gif&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=File:SA-Introduction_(2).gif</id>
		<title>File:SA-Introduction (2).gif</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=File:SA-Introduction_(2).gif"/>
				<updated>2021-05-04T12:27:29Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: Abinash uploaded a new version of &amp;amp;quot;File:SA-Introduction (2).gif&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=File:Source_Analysis1.jpg</id>
		<title>File:Source Analysis1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=File:Source_Analysis1.jpg"/>
				<updated>2021-05-04T12:25:21Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: Abinash uploaded a new version of &amp;amp;quot;File:Source Analysis1.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=File:Source_Analysis1.jpg</id>
		<title>File:Source Analysis1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=File:Source_Analysis1.jpg"/>
				<updated>2021-05-04T12:24:16Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: Abinash uploaded a new version of &amp;amp;quot;File:Source Analysis1.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Source_Analysis_Introduction</id>
		<title>Source Analysis Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Source_Analysis_Introduction"/>
				<updated>2021-05-04T12:06:24Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Standard or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The Source Analysis module provides a highly interactive environment for analyzing the sources of electric or magnetic brain activity.&lt;br /&gt;
&lt;br /&gt;
The following chapters will guide you through the most important features of the Source Analysis module in chronological order of data processing. For a thorough introduction to source analysis, we also recommend that you work through the [[https://www.besa.de/downloads/training-material/tutorials/ tutorials]] that are available for download on [[https://www.besa.de/ our website]].&lt;br /&gt;
&lt;br /&gt;
The ''Reference'' chapter in our online help offers a detailed description of the available features. It is subdivided into the following sections: ''Menu Bar, Popup Menus, Special Controls, Dialog Boxes.''&lt;br /&gt;
&lt;br /&gt;
==  Starting the Source Analysis Module ==&lt;br /&gt;
&lt;br /&gt;
Once you have opened a file for source analysis, you can decide which part of the averaged data will be analyzed. The BESA format for file segments (fsg-format) separates different averaged conditions by segment boundaries, as in the example file shown below.&lt;br /&gt;
&lt;br /&gt;
[[Image:Source_Analysis1.jpg]]&lt;br /&gt;
&lt;br /&gt;
To mark the entire condition on the left, simply click the right mouse button somewhere in the condition and select the popup menu entry &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Whole Segment'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To mark a part of the condition, create a block somewhere within the left condition by dragging with the left mouse button. Then press the right mouse button to obtain a popup menu containing the following entries:&lt;br /&gt;
&lt;br /&gt;
[[Image:SA-Introduction (2).gif |top]]&lt;br /&gt;
&lt;br /&gt;
Choosing ''Source Analysis'' opens the following dialog box:&lt;br /&gt;
&lt;br /&gt;
[[Image:SA-Introduction (3).gif |top]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The left-hand '''Block Size and Position''' section controls the time interval which is sent to the Source Analysis module. The predefined setting is to make a custom definition of the block size. You can change the settings to mark the whole segment. If you choose ''Custom Definition'', the bottom part of the section becomes active, and you can enter the exact time range you wish to analyze. If you choose ''All Conditions'', all conditions in the current data set are sent to the Source Analysis module.&lt;br /&gt;
* In the '''Filter Settings''' section, high frequency cutoff filters or low frequency cutoff filters can be quickly switched on and off using the'' Enabled'' tick mark.&lt;br /&gt;
* The &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Source Analysis'''&amp;lt;/span&amp;gt; button applies the settings and immediately starts the Source Analysis module.&lt;br /&gt;
* You can apply the settings to the data block using the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Set Block'''&amp;lt;/span&amp;gt; button.&lt;br /&gt;
* The&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Cancel'''&amp;lt;/span&amp;gt; button closes the dialog box without modifications.&lt;br /&gt;
* If the option ''All Conditions'' is selected while the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Sou&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;rce Analysis'''&amp;lt;/span&amp;gt; button is pressed, all conditions of the current data file (instead of only the selected c condition) are sent into the Source Analysis window simultaneously using the specified parameters.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tip:'''&lt;br /&gt;
&lt;br /&gt;
If you want to analyze a second data block with the same settings as before, mark an arbitrary block within the other data segment and click the right mouse button. The settings that you chose previously are displayed in the popup menu:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:SA-Introduction (5).gif |top]]&lt;br /&gt;
&lt;br /&gt;
Selecting the entry at the bottom automatically reproduces the settings and starts the Source Analysis module with the specified data block.&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=MATLAB_Interface</id>
		<title>MATLAB Interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=MATLAB_Interface"/>
				<updated>2021-05-04T10:42:22Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* How the interface works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= MATLAB Interface =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
BESA Research has menu items ''&amp;quot;Send to MATLAB...&amp;quot;'' at various locations that allow to send data as structures to MATLAB. After sending the data, BESA Research starts a MATLAB script that can be used to start further data analysis on the data structure. These scripts, located in the ''Scripts\Matlab'' folder in the BESA Research installation, can be edited by the user to perform further data analysis in MATLAB. For example, if &amp;quot;''Send to MATLAB''&amp;quot; is selected in the ''File Export Dialog'', a data structure &amp;quot;''besa_channels''&amp;quot; will be created. After filling the structure, the script &amp;quot;''besa_action_channels.m''&amp;quot; will be started.&lt;br /&gt;
&lt;br /&gt;
All the MATLAB export functions are batchable. Thus, a complete data analysis can be performed, in which BESA Research does the preprocessing, and passes the data on to MATLAB for a statistical analysis of the results.&lt;br /&gt;
&lt;br /&gt;
An example for the application of the MATLAB interface is demonstrated in the BESA Research Tutorial. You can download this tutorial from [https://www.besa.de/downloads/training-material/tutorials our website].&lt;br /&gt;
&lt;br /&gt;
Some MATLAB scripts that can be used in conjunction with the BESA Research MATLAB interface are also available on our website at https://www.besa.de/downloads/matlab/. You are invited to send your own scripts for data analysis or to submit any questions or feedback here: https://www.besa.de/support/support-page/.&lt;br /&gt;
&lt;br /&gt;
'''Important! Please follow the instructions in the “''Installation” ''chapter! Then read the “''How the interface'' ''works” ''section to get started.'''&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
In order for the BESA-MATLAB interface to work, please follow the instructions below. If you start BESA Research, and the file menu does not display the &amp;quot;''Send to MATLAB''&amp;quot; item, the interface is not installed correctly!&lt;br /&gt;
&lt;br /&gt;
'''1'''. '''MATLAB must be installed.'''&lt;br /&gt;
&lt;br /&gt;
For the next step (required for MATLAB versions 2009b and over), we need to know whether the 32-bit or 64-bit version of MATLAB is installed. We also need to know the path to the Matlab installation (e.g. ''C:\Program'' ''Files\MATLAB\2009b\)''.&lt;br /&gt;
&lt;br /&gt;
'''2'''. '''PATH environment variable:'''&lt;br /&gt;
&lt;br /&gt;
For versions 2009b and over, make sure that the path to the Win32 or Win64 folder in the MATLAB installation to the PATH environment variable is defined:&lt;br /&gt;
&lt;br /&gt;
* The path for MATLAB 2009b:&lt;br /&gt;
** The path for the 64-bit version for MATLAB 2009b is typically ''C:\Program'' ''Files\MATLAB\2009b\bin\win64''. &lt;br /&gt;
** For the 32-bit version, the path is typically ''C:\Program Files\MATLAB\2009b\bin\win32''.&lt;br /&gt;
&lt;br /&gt;
* Open the &amp;amp;quot;&amp;lt;span style=&amp;quot;font-weight: bold;&amp;quot;&amp;gt;System Properties&amp;lt;/span&amp;gt;&amp;amp;quot; Dialog by holding down the &amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;Windows&amp;lt;/span&amp;gt; key and pressing the &amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;Pause&amp;lt;/span&amp;gt; key at the same time.&lt;br /&gt;
** In Window 7, the key combination opens the &amp;amp;quot;&amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;System Display&amp;lt;/span&amp;gt;&amp;amp;quot;. Click on the link &amp;amp;quot;&amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;Change Settings&amp;lt;/span&amp;gt;&amp;amp;quot;&lt;br /&gt;
** In Windows 8 and Windows 10, the key combination also opens the &amp;amp;quot;&amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;System Display&amp;lt;/span&amp;gt;&amp;amp;quot;. Click on the link &amp;amp;quot;&amp;lt;span style=&amp;quot;font-weight: bold;&amp;quot;&amp;gt;Advanced system settings&amp;lt;/span&amp;gt;&amp;amp;quot;.&lt;br /&gt;
*** Skip the step in this description, as you have already chosen the advanced settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (1) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Select the &amp;quot;Advanced&amp;quot; tab in the &amp;amp;quot;''System Properties''&amp;amp;quot; dialog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (2) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Environment Variables...'''&amp;lt;/span&amp;gt;&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (3) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Under &amp;quot;System variables&amp;quot; click on the &amp;quot;Path&amp;quot; variable and press &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Edit...'''&amp;lt;/span&amp;gt;&amp;quot;. &lt;br /&gt;
* In the resulting dialog, enter a semicolon (;) at the end of the path string, and add the path after the semicolon.&lt;br /&gt;
* In Windows 10, click the &amp;amp;quot;''New''&amp;amp;quot; button in the resulting dialog and then add the path.&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (4) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Press &amp;quot;''OK''&amp;quot; to close and save the path variable. Click &amp;quot;''OK''&amp;quot; to close the &amp;quot;''System Properties''&amp;quot; Dialog. When using Windows 7/8/10, you will also need to close the &amp;quot;''Control Panel''&amp;quot; window afterwards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Additional configuration''' (only required after a change of your MATLAB configuration after installation of BESA Research):&lt;br /&gt;
&lt;br /&gt;
During the installation process of BESA Research, the program '''ConfigureBesaMatlabInterface.exe''' (or SetupBesaMatlabInterface'''.'''exe) in the BESA Research root folder root folder (C:\Program Files (x86)\BESA\Research_7_1) was executed.&lt;br /&gt;
&lt;br /&gt;
Run this program as '''administrator''' again when your MATLAB configuration has changed, e.g. after updating your MATLAB version. In the drop-down list, select the Matlab version that you are using.&lt;br /&gt;
&lt;br /&gt;
In the dropdown list, select the MATLAB version that you are using. &lt;br /&gt;
&lt;br /&gt;
This program does two operations: &lt;br /&gt;
&lt;br /&gt;
1. it copies the appropriate interface Dll to the BESA Research root folder and renames it to &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab.dll'''&amp;lt;/span&amp;gt;&amp;quot; (32-bit version) or &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab64.dll'''&amp;lt;/span&amp;gt;&amp;quot; (64-bit version), and &lt;br /&gt;
&lt;br /&gt;
2. if you are using a 64-bit version it creates an entry in '''BESA.ini''' (C:\Users\Public\Documents\BESA\Research_7_1) as follows:&lt;br /&gt;
[Matlab]&lt;br /&gt;
&lt;br /&gt;
Platform=64&lt;br /&gt;
&lt;br /&gt;
'''4. Updating the MATLAB Interface after MATLAB Upgrade:'''&lt;br /&gt;
&lt;br /&gt;
Sometimes, the BESA to MATLAB interface stops working after installation of new/additional MATLAB version on one computer. The reason is the registry change/corruption caused by the newly installed version. In order to correct this, one has to perform the following steps:&lt;br /&gt;
&lt;br /&gt;
* Make sure that the correct MATLAB interface dll ('''BesaMatlab.dll''' (32-bit version) or '''BesaMatlab64.dll''' (64-bit version)) is installed by starting the tool '''ConfigureBesaMatlabInterface.exe''' (or SetupBesaMatlabInterface.exe) and selecting the corresponding MATLAB version and architecture.&lt;br /&gt;
* Run '''CMD (Command Prompt) as administrator''', and then execute the following command (registers MATLAB as a Component Object Model (COM) server).:&lt;br /&gt;
** &amp;lt;code&amp;gt;matlab -regserver&amp;lt;/code&amp;gt;&lt;br /&gt;
** Close the CMD window (there should be no error message).&lt;br /&gt;
** Sometimes if the MATLAB license is connected to a specific user account and the user account does not have administrator rights, it could be problematic to execute that command. In that case, change the corresponding account to an administrator account and then perform the actions again. After that the account could be made to regular user account again.&lt;br /&gt;
* Run '''CMD (Command Prompt) as NOT administrator''', and then execute the following command (Manually create automation server: start MATLAB as a Component Object Model (COM) Automation server. MATLAB does not display the splash screen).:&lt;br /&gt;
**&amp;lt;code&amp;gt;matlab -automation&amp;lt;/code&amp;gt;&lt;br /&gt;
** Close the CMD and MATLAB Command Window (there should be no error message).&lt;br /&gt;
&lt;br /&gt;
'''5. Testing:'''&lt;br /&gt;
&lt;br /&gt;
Start BESA Research and check if ''Send to MATLAB ''is displayed in the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' File '''&amp;lt;/span&amp;gt;menu. If it is, the interface is set up correctly. (Note that the item will be grayed if no file is open in BESA Research.)&lt;br /&gt;
&lt;br /&gt;
Test the interface: open a data file, mark a short (e.g. 1 s) time range, and select ''File / Send to Matlab'' to open the ''Export Dialog'':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MATLAB window should open, and BESA Research will display a progress bar:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (6) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After the window closes, open the MATLAB window, and type &amp;quot;'''workspace'''&amp;quot; to open the workspace window, or &amp;quot;'''desktop'''&amp;quot; to open the standard MATLAB desktop.&lt;br /&gt;
&lt;br /&gt;
Examine the &amp;quot;'''&amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt;'''&amp;quot; variable, which contains the data for the marked data segment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (7) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Troubleshooting if the interface is not working after the above steps'''&lt;br /&gt;
&lt;br /&gt;
If the ''File / Send to MATLAB''... menu item is not shown, this means that either the path (step 2 above) is not defined properly, or that the interface Dll &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab.dll'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab64.dll'''&amp;lt;/span&amp;gt; is not compatible with the currently installed version of MATLAB.&lt;br /&gt;
&lt;br /&gt;
If the path is correct, then please contact our support team here: https://www.besa.de/support/support-page/, including the following information:&lt;br /&gt;
* Which MATLAB version are you using?&lt;br /&gt;
* Specify also if you are using the 32-bit or 64-bit version.&lt;br /&gt;
&lt;br /&gt;
== How the interface works ==&lt;br /&gt;
&lt;br /&gt;
'''The interface'''&lt;br /&gt;
&lt;br /&gt;
The interface uses libraries supplied by Matlab. Their descriptions can be found in Matlab Help under the keywords &amp;quot;Engine Library&amp;quot;. The Matlab libraries are incorporated into the interface Dll (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab.dll'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab64.dll'''&amp;lt;/span&amp;gt;) that provides the interface between BESA Research and Matlab. As newer versions of Matlab are released, it may be necessary to generate new versions of the dll to match the new library versions.&lt;br /&gt;
&lt;br /&gt;
'''Matlab automation window'''&lt;br /&gt;
&lt;br /&gt;
On the first call to one of the Matlab routines, the Matlab Automation Window is opened. This is not the same as the window that is normally opened when Matlab is started directly in Windows (the window can also be opened by typing &amp;quot;Matlab /automation&amp;quot; from the command line). From the Automation Window one can run normal Matlab scripts. It is also possible to type &amp;quot;'''&amp;lt;code&amp;gt;desktop&amp;lt;/code&amp;gt;'''&amp;quot; in the Automation Window to open the standard Matlab desktop. All variables that have been sent from BESA Research are then visible there.&lt;br /&gt;
&lt;br /&gt;
'''BESA Research &amp;quot;Send to MATLAB&amp;quot; commands and scripts'''&lt;br /&gt;
&lt;br /&gt;
Send to MATLAB commands generate data structures that differ depending on the type of data that are sent. After each export the corresponding script is executed. They are available at the following locations in BESA Research:&lt;br /&gt;
* From the Main program window (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu), as part of the ''Export Dialog''. Structure name ''besa_channels''. Script name ''besa_action_channels.m''.&lt;br /&gt;
* From the FFT analysis (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu). Structure name ''besa_fft''. Script name ''besa_action_fft.m''.&lt;br /&gt;
* From Combine Conditions (''Run Scripts Tab''), in the export of peaks and mean amplitudes. Structure name ''besa_peak''. Script name ''besa_action_peak.m''.&lt;br /&gt;
* From Source Analysis (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu), for exporting source waveforms (''besa_sourcewaveforms''), source models (''besa_sourcemodel''), data, residual and model waveforms (''besa_sa_channels''), and 3D images (''besa_image''). Script names ''besa_action_sourcewaveforms.m'', ''besa_action_sourcemodel.m'', ''besa_action_sa_channels.m'', and ''besa_action_image.m''.&lt;br /&gt;
* From Time-Frequency/Coherence Analysis (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu). Structure names ''besa_tfc'', and ''besa_tfc_trials'' (for single-trial time-frequency data). Script names ''besa_action_tfc.m'' and ''besa_action_tfc_trials.m''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some additional scripts are used for specific data types. For example, when exporting raw data, two scripts, ''besa_helper_channels_event.m'' and ''besa_helper_channels_continuousdata.m'' are used to collect events from each data block and to combine the exported data blocks into a single matrix.&lt;br /&gt;
&lt;br /&gt;
'''Command script path'''&lt;br /&gt;
&lt;br /&gt;
When the commands are executed, BESA Research automatically executes an &amp;quot;addpath&amp;quot; command in Matlab to add the ''Scripts\MATLAB'' folder (in Windows 7 typically ''C:\Users\Public\Public'' ''Documents\BESA\Research_7_1\Scripts\MATLAB'') and its first-level subfolders to the Matlab search path.&lt;br /&gt;
&lt;br /&gt;
'''Units'''&lt;br /&gt;
&lt;br /&gt;
Unless otherwise stated, distances are in meters, times are in seconds, and the head-frame (fiducial-based) coordinate system is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=MATLAB_Interface</id>
		<title>MATLAB Interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=MATLAB_Interface"/>
				<updated>2021-05-04T10:41:47Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= MATLAB Interface =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
BESA Research has menu items ''&amp;quot;Send to MATLAB...&amp;quot;'' at various locations that allow to send data as structures to MATLAB. After sending the data, BESA Research starts a MATLAB script that can be used to start further data analysis on the data structure. These scripts, located in the ''Scripts\Matlab'' folder in the BESA Research installation, can be edited by the user to perform further data analysis in MATLAB. For example, if &amp;quot;''Send to MATLAB''&amp;quot; is selected in the ''File Export Dialog'', a data structure &amp;quot;''besa_channels''&amp;quot; will be created. After filling the structure, the script &amp;quot;''besa_action_channels.m''&amp;quot; will be started.&lt;br /&gt;
&lt;br /&gt;
All the MATLAB export functions are batchable. Thus, a complete data analysis can be performed, in which BESA Research does the preprocessing, and passes the data on to MATLAB for a statistical analysis of the results.&lt;br /&gt;
&lt;br /&gt;
An example for the application of the MATLAB interface is demonstrated in the BESA Research Tutorial. You can download this tutorial from [https://www.besa.de/downloads/training-material/tutorials our website].&lt;br /&gt;
&lt;br /&gt;
Some MATLAB scripts that can be used in conjunction with the BESA Research MATLAB interface are also available on our website at https://www.besa.de/downloads/matlab/. You are invited to send your own scripts for data analysis or to submit any questions or feedback here: https://www.besa.de/support/support-page/.&lt;br /&gt;
&lt;br /&gt;
'''Important! Please follow the instructions in the “''Installation” ''chapter! Then read the “''How the interface'' ''works” ''section to get started.'''&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
In order for the BESA-MATLAB interface to work, please follow the instructions below. If you start BESA Research, and the file menu does not display the &amp;quot;''Send to MATLAB''&amp;quot; item, the interface is not installed correctly!&lt;br /&gt;
&lt;br /&gt;
'''1'''. '''MATLAB must be installed.'''&lt;br /&gt;
&lt;br /&gt;
For the next step (required for MATLAB versions 2009b and over), we need to know whether the 32-bit or 64-bit version of MATLAB is installed. We also need to know the path to the Matlab installation (e.g. ''C:\Program'' ''Files\MATLAB\2009b\)''.&lt;br /&gt;
&lt;br /&gt;
'''2'''. '''PATH environment variable:'''&lt;br /&gt;
&lt;br /&gt;
For versions 2009b and over, make sure that the path to the Win32 or Win64 folder in the MATLAB installation to the PATH environment variable is defined:&lt;br /&gt;
&lt;br /&gt;
* The path for MATLAB 2009b:&lt;br /&gt;
** The path for the 64-bit version for MATLAB 2009b is typically ''C:\Program'' ''Files\MATLAB\2009b\bin\win64''. &lt;br /&gt;
** For the 32-bit version, the path is typically ''C:\Program Files\MATLAB\2009b\bin\win32''.&lt;br /&gt;
&lt;br /&gt;
* Open the &amp;amp;quot;&amp;lt;span style=&amp;quot;font-weight: bold;&amp;quot;&amp;gt;System Properties&amp;lt;/span&amp;gt;&amp;amp;quot; Dialog by holding down the &amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;Windows&amp;lt;/span&amp;gt; key and pressing the &amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;Pause&amp;lt;/span&amp;gt; key at the same time.&lt;br /&gt;
** In Window 7, the key combination opens the &amp;amp;quot;&amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;System Display&amp;lt;/span&amp;gt;&amp;amp;quot;. Click on the link &amp;amp;quot;&amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;Change Settings&amp;lt;/span&amp;gt;&amp;amp;quot;&lt;br /&gt;
** In Windows 8 and Windows 10, the key combination also opens the &amp;amp;quot;&amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;System Display&amp;lt;/span&amp;gt;&amp;amp;quot;. Click on the link &amp;amp;quot;&amp;lt;span style=&amp;quot;font-weight: bold;&amp;quot;&amp;gt;Advanced system settings&amp;lt;/span&amp;gt;&amp;amp;quot;.&lt;br /&gt;
*** Skip the step in this description, as you have already chosen the advanced settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (1) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Select the &amp;quot;Advanced&amp;quot; tab in the &amp;amp;quot;''System Properties''&amp;amp;quot; dialog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (2) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Environment Variables...'''&amp;lt;/span&amp;gt;&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (3) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Under &amp;quot;System variables&amp;quot; click on the &amp;quot;Path&amp;quot; variable and press &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Edit...'''&amp;lt;/span&amp;gt;&amp;quot;. &lt;br /&gt;
* In the resulting dialog, enter a semicolon (;) at the end of the path string, and add the path after the semicolon.&lt;br /&gt;
* In Windows 10, click the &amp;amp;quot;''New''&amp;amp;quot; button in the resulting dialog and then add the path.&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (4) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Press &amp;quot;''OK''&amp;quot; to close and save the path variable. Click &amp;quot;''OK''&amp;quot; to close the &amp;quot;''System Properties''&amp;quot; Dialog. When using Windows 7/8/10, you will also need to close the &amp;quot;''Control Panel''&amp;quot; window afterwards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Additional configuration''' (only required after a change of your MATLAB configuration after installation of BESA Research):&lt;br /&gt;
&lt;br /&gt;
During the installation process of BESA Research, the program '''ConfigureBesaMatlabInterface.exe''' (or SetupBesaMatlabInterface'''.'''exe) in the BESA Research root folder root folder (C:\Program Files (x86)\BESA\Research_7_1) was executed.&lt;br /&gt;
&lt;br /&gt;
Run this program as '''administrator''' again when your MATLAB configuration has changed, e.g. after updating your MATLAB version. In the drop-down list, select the Matlab version that you are using.&lt;br /&gt;
&lt;br /&gt;
In the dropdown list, select the MATLAB version that you are using. &lt;br /&gt;
&lt;br /&gt;
This program does two operations: &lt;br /&gt;
&lt;br /&gt;
1. it copies the appropriate interface Dll to the BESA Research root folder and renames it to &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab.dll'''&amp;lt;/span&amp;gt;&amp;quot; (32-bit version) or &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab64.dll'''&amp;lt;/span&amp;gt;&amp;quot; (64-bit version), and &lt;br /&gt;
&lt;br /&gt;
2. if you are using a 64-bit version it creates an entry in '''BESA.ini''' (C:\Users\Public\Documents\BESA\Research_7_1) as follows:&lt;br /&gt;
[Matlab]&lt;br /&gt;
&lt;br /&gt;
Platform=64&lt;br /&gt;
&lt;br /&gt;
'''4. Updating the MATLAB Interface after MATLAB Upgrade:'''&lt;br /&gt;
&lt;br /&gt;
Sometimes, the BESA to MATLAB interface stops working after installation of new/additional MATLAB version on one computer. The reason is the registry change/corruption caused by the newly installed version. In order to correct this, one has to perform the following steps:&lt;br /&gt;
&lt;br /&gt;
* Make sure that the correct MATLAB interface dll ('''BesaMatlab.dll''' (32-bit version) or '''BesaMatlab64.dll''' (64-bit version)) is installed by starting the tool '''ConfigureBesaMatlabInterface.exe''' (or SetupBesaMatlabInterface.exe) and selecting the corresponding MATLAB version and architecture.&lt;br /&gt;
* Run '''CMD (Command Prompt) as administrator''', and then execute the following command (registers MATLAB as a Component Object Model (COM) server).:&lt;br /&gt;
** &amp;lt;code&amp;gt;matlab -regserver&amp;lt;/code&amp;gt;&lt;br /&gt;
** Close the CMD window (there should be no error message).&lt;br /&gt;
** Sometimes if the MATLAB license is connected to a specific user account and the user account does not have administrator rights, it could be problematic to execute that command. In that case, change the corresponding account to an administrator account and then perform the actions again. After that the account could be made to regular user account again.&lt;br /&gt;
* Run '''CMD (Command Prompt) as NOT administrator''', and then execute the following command (Manually create automation server: start MATLAB as a Component Object Model (COM) Automation server. MATLAB does not display the splash screen).:&lt;br /&gt;
**&amp;lt;code&amp;gt;matlab -automation&amp;lt;/code&amp;gt;&lt;br /&gt;
** Close the CMD and MATLAB Command Window (there should be no error message).&lt;br /&gt;
&lt;br /&gt;
'''5. Testing:'''&lt;br /&gt;
&lt;br /&gt;
Start BESA Research and check if ''Send to MATLAB ''is displayed in the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' File '''&amp;lt;/span&amp;gt;menu. If it is, the interface is set up correctly. (Note that the item will be grayed if no file is open in BESA Research.)&lt;br /&gt;
&lt;br /&gt;
Test the interface: open a data file, mark a short (e.g. 1 s) time range, and select ''File / Send to Matlab'' to open the ''Export Dialog'':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MATLAB window should open, and BESA Research will display a progress bar:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (6) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After the window closes, open the MATLAB window, and type &amp;quot;'''workspace'''&amp;quot; to open the workspace window, or &amp;quot;'''desktop'''&amp;quot; to open the standard MATLAB desktop.&lt;br /&gt;
&lt;br /&gt;
Examine the &amp;quot;'''&amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt;'''&amp;quot; variable, which contains the data for the marked data segment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (7) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Troubleshooting if the interface is not working after the above steps'''&lt;br /&gt;
&lt;br /&gt;
If the ''File / Send to MATLAB''... menu item is not shown, this means that either the path (step 2 above) is not defined properly, or that the interface Dll &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab.dll'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab64.dll'''&amp;lt;/span&amp;gt; is not compatible with the currently installed version of MATLAB.&lt;br /&gt;
&lt;br /&gt;
If the path is correct, then please contact our support team here: https://www.besa.de/support/support-page/, including the following information:&lt;br /&gt;
* Which MATLAB version are you using?&lt;br /&gt;
* Specify also if you are using the 32-bit or 64-bit version.&lt;br /&gt;
&lt;br /&gt;
== How the interface works ==&lt;br /&gt;
&lt;br /&gt;
'''The interface'''&lt;br /&gt;
&lt;br /&gt;
The interface uses libraries supplied by Matlab. Their descriptions can be found in Matlab Help under the keywords &amp;quot;Engine Library&amp;quot;. The Matlab libraries are incorporated into the interface Dll (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab.dll'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab64.dll'''&amp;lt;/span&amp;gt;) that provides the interface between BESA Research and Matlab. As newer versions of Matlab are released, it may be necessary to generate new versions of the dll to match the new library versions.&lt;br /&gt;
&lt;br /&gt;
'''Matlab automation window'''&lt;br /&gt;
&lt;br /&gt;
On the first call to one of the Matlab routines, the Matlab Automation Window is opened. This is not the same as the window that is normally opened when Matlab is started directly in Windows (the window can also be opened by typing &amp;quot;Matlab /automation&amp;quot; from the command line). From the Automation Window one can run normal Matlab scripts. It is also possible to type &amp;quot;'''&amp;lt;code&amp;gt;desktop&amp;lt;/code&amp;gt;'''&amp;quot; in the Automation Window to open the standard Matlab desktop. All variables that have been sent from BESA Research are then visible there.&lt;br /&gt;
&lt;br /&gt;
'''BESA Research &amp;quot;Send to MATLAB&amp;quot; commands and scripts'''&lt;br /&gt;
&lt;br /&gt;
Send to MATLAB commands generate data structures that differ depending on the type of data that are sent. After each export the corresponding script is executed. They are available at the following locations in BESA Research:&lt;br /&gt;
* From the Main program window (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu), as part of the ''Export Dialog''. Structure name ''besa_channels''. Script name ''besa_action_channels.m''.&lt;br /&gt;
* From the FFT analysis (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu). Structure name ''besa_fft''. Script name ''besa_action_fft.m''.&lt;br /&gt;
* From Combine Conditions (''Run Scripts Tab''), in the export of peaks and mean amplitudes. Structure name ''besa_peak''. Script name ''besa_action_peak.m''.&lt;br /&gt;
* From Source Analysis (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu), for exporting source waveforms (''besa_sourcewaveforms''), source models (''besa_sourcemodel''), data, residual and model waveforms (''besa_sa_channels''), and 3D images (''besa_image''). Script names ''besa_action_sourcewaveforms.m'', ''besa_action_sourcemodel.m'', ''besa_action_sa_channels.m'', and ''besa_action_image.m''.&lt;br /&gt;
* From Time-Frequency/Coherence Analysis (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu). Structure names ''besa_tfc'', and ''besa_tfc_trials'' (for single-trial time-frequency data). Script names ''besa_action_tfc.m'' and ''besa_action_tfc_trials.m''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some additional scripts are used for specific data types. For example, when exporting raw data, two scripts, ''besa_helper_channels_event.m'' and ''besa_helper_channels_continuousdata.m'' are used to collect events from each data block and to combine the exported data blocks into a single matrix.&lt;br /&gt;
&lt;br /&gt;
'''Command script path'''&lt;br /&gt;
&lt;br /&gt;
When the commands are executed, BESA Research automatically executes an &amp;quot;addpath&amp;quot; command in Matlab to add the ''Scripts\MATLAB'' folder (in Windows 7 typically ''C:\Users\Public\Public'' ''Documents\BESA\Research_6_0\Scripts\MATLAB'') and its first-level subfolders to the Matlab search path.&lt;br /&gt;
&lt;br /&gt;
'''Units'''&lt;br /&gt;
&lt;br /&gt;
Unless otherwise stated, distances are in meters, times are in seconds, and the head-frame (fiducial-based) coordinate system is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=MATLAB_Interface</id>
		<title>MATLAB Interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=MATLAB_Interface"/>
				<updated>2021-05-04T10:10:44Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= MATLAB Interface =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
BESA Research has menu items ''&amp;quot;Send to MATLAB...&amp;quot;'' at various locations that allow to send data as structures to MATLAB. After sending the data, BESA Research starts a MATLAB script that can be used to start further data analysis on the data structure. These scripts, located in the ''Scripts\Matlab'' folder in the BESA Research installation, can be edited by the user to perform further data analysis in MATLAB. For example, if &amp;quot;''Send to MATLAB''&amp;quot; is selected in the ''File Export Dialog'', a data structure &amp;quot;''besa_channels''&amp;quot; will be created. After filling the structure, the script &amp;quot;''besa_action_channels.m''&amp;quot; will be started.&lt;br /&gt;
&lt;br /&gt;
All the MATLAB export functions are batchable. Thus, a complete data analysis can be performed, in which BESA Research does the preprocessing, and passes the data on to MATLAB for a statistical analysis of the results.&lt;br /&gt;
&lt;br /&gt;
An example for the application of the MATLAB interface is demonstrated in the BESA Research Tutorial. You can download this tutorial from [https://www.besa.de/downloads/training-material/tutorials our website].&lt;br /&gt;
&lt;br /&gt;
Some MATLAB scripts that can be used in conjunction with the BESA Research MATLAB interface are also available on our website at https://www.besa.de/downloads/matlab/. You are invited to send your own scripts for data analysis or to submit any questions or feedback here: https://www.besa.de/support/support-page/.&lt;br /&gt;
&lt;br /&gt;
'''Important! Please follow the instructions in the “''Installation” ''chapter! Then read the “''How the interface'' ''works” ''section to get started.'''&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
In order for the BESA-Matlab interface to work, please follow the instructions below. If you start BESA Research, and the file menu does not display the &amp;quot;''Send to MATLAB''&amp;quot; item, the interface is not installed correctly!&lt;br /&gt;
&lt;br /&gt;
'''1'''. '''Matlab must be installed.'''&lt;br /&gt;
&lt;br /&gt;
For step 2 (required for MATLAB versions 2009b and over), we need to know whether the 32-bit or 64-bit version of Matlab is installed. We also need to know the path to the Matlab installation (e.g. ''C:\Program'' ''Files\MATLAB\2009b\)''.&lt;br /&gt;
&lt;br /&gt;
'''2'''. '''PATH environment variable:'''&lt;br /&gt;
&lt;br /&gt;
For versions 2009b and over, make sure that the path to the Win32 or Win64 folder in the Matlab installation to the PATH environment variable is defined:&lt;br /&gt;
&lt;br /&gt;
* The path for the 64-bit version for Matlab 2009b is typically ''C:\Program'' ''Files\MATLAB\2009b\bin\win64''. For the 32-bit version, the path is typically ''C:\Program Files\MATLAB\2009b\bin\win32''.&lt;br /&gt;
* Open the &amp;quot;System Properties&amp;quot; Dialog by holding down the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Windows'''&amp;lt;/span&amp;gt; key and pressing the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Pause '''&amp;lt;/span&amp;gt;button. In XP, the dialog is opened directly. In Vista and Window 7, the key combination opens the System Display. Click on the link &amp;quot;Change Settings&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (1) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Select the &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (2) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Press the &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Environment Variables'''&amp;lt;/span&amp;gt;&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (3) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Under &amp;quot;System variables&amp;quot; click on the &amp;quot;Path&amp;quot; variable and press &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Edit'''&amp;lt;/span&amp;gt;&amp;quot;. In the resulting dialog, enter a semicolon (;) at the end of the path string, and add the path after the semicolon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (4) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Press &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;quot; to close and save the path variable. Press &amp;quot;&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''OK'''&amp;lt;/span&amp;gt;&amp;quot; to close the &amp;quot;System Properties&amp;quot; Dialog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Additional configuration''' (only required after a change of your MATLAB configuration after installation of BESA Research):&lt;br /&gt;
&lt;br /&gt;
During the installation process of BESA Research, the program &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#00000a;&amp;quot;&amp;gt;''SetupBesaMatlabInterface.exe''&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;quot; in the BESA Research root folder was executed. Run this program again when your MATLAB configuration has changed, e.g. after updating your MATLAB version.&lt;br /&gt;
&lt;br /&gt;
In the dropdown list, select the Matlab version that you are using. &lt;br /&gt;
&lt;br /&gt;
This program does two operations: &lt;br /&gt;
&lt;br /&gt;
1. it copies the appropriate interface Dll to the BESA Research root folder and renames it to &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab.dll'''&amp;lt;/span&amp;gt;&amp;quot; (32-bit version) or &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab64.dll'''&amp;lt;/span&amp;gt;&amp;quot; (64-bit version), and &lt;br /&gt;
&lt;br /&gt;
2. if you are using a 64-bit version it creates an entry in &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BESA.ini'''&amp;lt;/span&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
[Matlab]&lt;br /&gt;
&lt;br /&gt;
Platform=64&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Testing:'''&lt;br /&gt;
&lt;br /&gt;
Start BESA Research and check if ''Send to MATLAB ''is displayed in the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' File '''&amp;lt;/span&amp;gt;menu. If it is, the interface is set up correctly. (Note that the item will be grayed if no file is open in BESA Research.)&lt;br /&gt;
&lt;br /&gt;
Test the interface: open a data file, mark a short (e.g. 1 s) time range, and select ''File / Send to Matlab'' to open the ''Export Dialog'':&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Matlab window should open, and BESA Research will display a progress bar:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (6) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After the window closes, open the Matlab window, and type &amp;quot;'''&amp;lt;code&amp;gt;workspace&amp;lt;/code&amp;gt;'''&amp;quot; to open the workspace window, or &amp;quot;'''&amp;lt;code&amp;gt;desktop&amp;lt;/code&amp;gt;'''&amp;quot; to open the standard Matlab desktop.&lt;br /&gt;
&lt;br /&gt;
Examine the &amp;quot;'''&amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt;'''&amp;quot; variable, which contains the data for the marked data segment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (7) .gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Troubleshooting if the interface is not working after the above steps'''&lt;br /&gt;
&lt;br /&gt;
If the ''File / Send to MATLAB''... menu item is not shown, this means that either the path (step 2 above) is not defined properly, or that the interface Dll &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab.dll'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab64.dll'''&amp;lt;/span&amp;gt; is not compatible with the currently installed version of Matlab.&lt;br /&gt;
&lt;br /&gt;
If the path is correct, then please contact our support team here: https://www.besa.de/support/support-page/, including the following information:&lt;br /&gt;
* Which Matlab version are you using?&lt;br /&gt;
* Specify also if you are using the 32-bit or 64-bit version.&lt;br /&gt;
&lt;br /&gt;
== How the interface works ==&lt;br /&gt;
&lt;br /&gt;
'''The interface'''&lt;br /&gt;
&lt;br /&gt;
The interface uses libraries supplied by Matlab. Their descriptions can be found in Matlab Help under the keywords &amp;quot;Engine Library&amp;quot;. The Matlab libraries are incorporated into the interface Dll (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab.dll'''&amp;lt;/span&amp;gt; or &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''BesaMatlab64.dll'''&amp;lt;/span&amp;gt;) that provides the interface between BESA Research and Matlab. As newer versions of Matlab are released, it may be necessary to generate new versions of the dll to match the new library versions.&lt;br /&gt;
&lt;br /&gt;
'''Matlab automation window'''&lt;br /&gt;
&lt;br /&gt;
On the first call to one of the Matlab routines, the Matlab Automation Window is opened. This is not the same as the window that is normally opened when Matlab is started directly in Windows (the window can also be opened by typing &amp;quot;Matlab /automation&amp;quot; from the command line). From the Automation Window one can run normal Matlab scripts. It is also possible to type &amp;quot;'''&amp;lt;code&amp;gt;desktop&amp;lt;/code&amp;gt;'''&amp;quot; in the Automation Window to open the standard Matlab desktop. All variables that have been sent from BESA Research are then visible there.&lt;br /&gt;
&lt;br /&gt;
'''BESA Research &amp;quot;Send to MATLAB&amp;quot; commands and scripts'''&lt;br /&gt;
&lt;br /&gt;
Send to MATLAB commands generate data structures that differ depending on the type of data that are sent. After each export the corresponding script is executed. They are available at the following locations in BESA Research:&lt;br /&gt;
* From the Main program window (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu), as part of the ''Export Dialog''. Structure name ''besa_channels''. Script name ''besa_action_channels.m''.&lt;br /&gt;
* From the FFT analysis (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu). Structure name ''besa_fft''. Script name ''besa_action_fft.m''.&lt;br /&gt;
* From Combine Conditions (''Run Scripts Tab''), in the export of peaks and mean amplitudes. Structure name ''besa_peak''. Script name ''besa_action_peak.m''.&lt;br /&gt;
* From Source Analysis (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu), for exporting source waveforms (''besa_sourcewaveforms''), source models (''besa_sourcemodel''), data, residual and model waveforms (''besa_sa_channels''), and 3D images (''besa_image''). Script names ''besa_action_sourcewaveforms.m'', ''besa_action_sourcemodel.m'', ''besa_action_sa_channels.m'', and ''besa_action_image.m''.&lt;br /&gt;
* From Time-Frequency/Coherence Analysis (&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''File'''&amp;lt;/span&amp;gt; Menu). Structure names ''besa_tfc'', and ''besa_tfc_trials'' (for single-trial time-frequency data). Script names ''besa_action_tfc.m'' and ''besa_action_tfc_trials.m''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some additional scripts are used for specific data types. For example, when exporting raw data, two scripts, ''besa_helper_channels_event.m'' and ''besa_helper_channels_continuousdata.m'' are used to collect events from each data block and to combine the exported data blocks into a single matrix.&lt;br /&gt;
&lt;br /&gt;
'''Command script path'''&lt;br /&gt;
&lt;br /&gt;
When the commands are executed, BESA Research automatically executes an &amp;quot;addpath&amp;quot; command in Matlab to add the ''Scripts\MATLAB'' folder (in Windows 7 typically ''C:\Users\Public\Public'' ''Documents\BESA\Research_6_0\Scripts\MATLAB'') and its first-level subfolders to the Matlab search path.&lt;br /&gt;
&lt;br /&gt;
'''Units'''&lt;br /&gt;
&lt;br /&gt;
Unless otherwise stated, distances are in meters, times are in seconds, and the head-frame (fiducial-based) coordinate system is used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Test_Page</id>
		<title>Test Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Test_Page"/>
				<updated>2021-05-04T09:27:36Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* This is a test page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:TestPage]]&lt;br /&gt;
==This is a test page==&lt;br /&gt;
This is a reference for The Origins of EEG &amp;lt;ref&amp;gt;[http://www.bri.ucla.edu/nha/ishn/ab24-2002.htm  Millet, David (2002). &amp;quot;The Origins of EEG&amp;quot;.]'' International Society for the History of the Neurosciences'' (ISHN).&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\zeta(s) = \sum_{n=1}^\infty \frac{1}{n^s} = \frac{1}{1^s} + \frac{1}{2^s} + \frac{1}{3^s} + \cdots.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
f(n) =&lt;br /&gt;
\begin{cases}&lt;br /&gt;
n/2, &amp;amp; \text{if }n\text{ is even} \\&lt;br /&gt;
3n+1, &amp;amp; \text{if }n\text{ is odd}&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{font color|red| &amp;lt;pre&amp;gt;    	0	0	0	0	0	0	0&amp;lt;br&amp;gt;0 0 0 0  0 0 &amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{font color|#FF1493|2.52 6.71 10.07 5.04 8.39 5.04 10.07 4.20 6.71 11.75 5.04 12.59 5.04 9.23 5.04 10.07 4.20 10.07 8.39 7.55 8.39 5.87 11.75 3.36 5.04 1.68}} &lt;br /&gt;
{{font color|#FF1493|7.55 2.52 10.91 5.04 6.71 5.04 2.52 5.04 12.59 11.75 14.27 5.87 6.71 6.71 7.55 2.52 13.43 15.11 5.87 8.39 3.36 7.55 8.39 13.43 2.52 8.39}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;iframe key=&amp;quot;test&amp;quot; path=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span title=&amp;quot;You can write a long text here but making a new page would be kinda complicated.&amp;quot; &amp;gt;Hover over me.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BESANav}}&lt;br /&gt;
&lt;br /&gt;
[[Category:TestPage]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=File:AudIntensity-average.bbat</id>
		<title>File:AudIntensity-average.bbat</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=File:AudIntensity-average.bbat"/>
				<updated>2021-02-09T09:49:29Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data</id>
		<title>Using BESA to correct blink and EKG artifacts in MEG data</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data"/>
				<updated>2021-02-02T13:26:01Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* Artifact options: which correction model? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Standard or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Eyeblinks and EKG cause large artifact signals in the magnetometer channels. The artifact correction facilities of BESA can correct these artifacts quite well. The procedure is quite simple for blinks but more complex for EKG. The following text outlines the procedures and current limitations of BESA for artifact correction.&lt;br /&gt;
&lt;br /&gt;
The principles of the artifact correction procedure are described in Berg and Scherg (1994).&lt;br /&gt;
&lt;br /&gt;
In summary, the following steps are required:&lt;br /&gt;
&lt;br /&gt;
* Use pattern search and average to identify the latencies of blink/EKG signals in the raw data. Pattern search works best if you have recorded a vertical EOG and EKG with the MEG data, but it will also work on selected MEG channels, using the appropriate filters.&lt;br /&gt;
* A spatial PCA is performed on the average to identify the main topographies/components of the artifact signal. For blinks, only one topography is required. For EKG, two or three topographies may be required.&lt;br /&gt;
* The topographies/components are combined into a coefficient file (''*.atf''). Using the '''Artifact''' Menu, the ''atf'' file can be loaded and correction switched on. Contrary to the warning message displayed by the ERP module, averaging can be performed using artifact corrected data.&lt;br /&gt;
* When the average is loaded into the Source Analysis module, the artifact coefficients (saved in the average file) need to be activated. They will then be incorporated into source modelling using subspace projection (SSP – see also Uusitalo et al. (1997)). In this case, SSP is equivalent to the “optimized correction method” described in Berg and Scherg (1994).&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
* Berg, P., and Scherg, M. A multiple source approach to the correction of eye artifacts, Electroenceph. clin. Neurophysiol., 1994, 90: 229-241.&lt;br /&gt;
* Uusitalo, M.A., Ilmoniemi, R.J. Signal-space projection method for separating MEG or EEG into components. Med. Biol. Eng. Comput., 1997, 35: 135-140.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pattern search for blinks and EKG ==&lt;br /&gt;
&lt;br /&gt;
=== Eyeblinks ===&lt;br /&gt;
&lt;br /&gt;
# Select filters 0.5 – 8 Hz ('''Filters/Edit Filter Settings…'''). Make sure the low cutoff filter type is '''Forward'''! (This is to ensure that no contribution from the blink topography bleeds back into the baseline time interval).&lt;br /&gt;
# View Polygraphic signals only (press the '''Pgr''' button at the top right of the BESA window), so that the vertical EOG channel is displayed&lt;br /&gt;
# Define the search block from –100 ms to +400 ms ('''Edit/Default Block Epoch…''')&lt;br /&gt;
# Select Pattern Search ('''Search/Pattern''')&lt;br /&gt;
# Select Search Query ('''Search/Query''')&lt;br /&gt;
# Select Buffer 1 for averaging ('''Tags/Pattern 1''')&lt;br /&gt;
# Identify a clear blink signal on the vertical EOG channel. Right-click at the '''onset''' of the blink, and select '''Default Block''' in the dropdown menu. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(1).png|75x55px]]&lt;br /&gt;
# Click once on the VEOG channel label, so that a rightward arrow is displayed (ignore the correlation window that opens on the right): [[File:EKG_artifacts_in_MEG_data__(2).png|100x55px]]&lt;br /&gt;
# Press the '''SAW''' button (Search/Average/Write). BESA will start scanning through the file, and it will stop at each occurrence of a blink. Press “Yes” to accept. “No” to reject, or “Stop asking” to let BESA accept everything automatically. Save the result to a file name of your choice (e.g. ''name_artifact.fsg''), labelling the segment, e.g. “blink”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
# In contrast to blink averaging we use two steps: first, filters are set to enhance the EKG for pattern search. Second, the filters are opened up, and the average is repeated.&lt;br /&gt;
# Select filters 5-20 Hz. This should generate a fairly clear signal on the EKG.&lt;br /&gt;
# Set the default block epoch so that the R-wave and the T-wave are well inside the epoch. The setting used for blinks may be OK, but you may need to extend the post-cursor interval, e.g. from 400 to 500 ms.&lt;br /&gt;
# Proceed as with blinks, but selecting Buffer 2 for averaging ('''Tags/Pattern 2'''). Mark a block around the onset of an R-wave. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(3).png|100x56px]]&lt;br /&gt;
# Save the average in the same file as the averaged blinks, labelling the segment, e.g. “EKG”.&lt;br /&gt;
# Select filters 1-30 Hz. Select '''Search/Tagged Events''', and press '''SAW'''. This repeats the average using the tags that were identified during the first step. Opening up the filters ensures that the average includes more of the EKG signal.&lt;br /&gt;
&lt;br /&gt;
=== What to do if there is no VEOG or EKG channel ===&lt;br /&gt;
&lt;br /&gt;
The procedure is similar to the above, but you need to identify a MEG channel that displays the blink or EKG waveform clearly. You may need to experiment with filter settings to make the artifact pattern clearer (the filter settings described above are not fixed rules – you may find that other settings work better for pattern search). You may find the “Create Triggers from EMG/EEG” tool helpful for detecting EKG ('''ERP/Create Triggers from EMG/EEG…'''). See the BESA help file (tutorial on creating triggers).&lt;br /&gt;
&lt;br /&gt;
== Spatial PCA and the *.atf file ==&lt;br /&gt;
&lt;br /&gt;
Open the file in which you saved the averages (e.g. ''name_artifact.fsg''). Make sure that prestimulus baseline correction is switched on ('''Filters/Use Prestimulus Baseline''').&lt;br /&gt;
&lt;br /&gt;
=== Blinks ===&lt;br /&gt;
&lt;br /&gt;
# Mark the whole blink epoch: Right-click onto the epoch, and select '''Whole Segment'''.&lt;br /&gt;
# Select '''Artifact/Assign/Blink'''. The spatial PCA is computed, and the first spatial component is assigned to describe the blink. You may check if the correction works by selecting '''Artifact/Correct'''.&lt;br /&gt;
# The coefficients are saved automatically to a file with the same basename as the average, and the extension ''“.atf''”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
EKG coefficients are corrected analogously to blinks. A difference is that the topographic distribution of the EKG over the MEG sensors is more complex than that of blinks. It changes over time. The reasons for this are unclear, and may be due to movement of the heart (and its equivalent dipoles) over time, but also to ballistic effects: movement of the head due to blood flow.&lt;br /&gt;
&lt;br /&gt;
Since topographic distribution changes over time, more than one component is required for correction. We choose the number of components in the Artifact Select Dialog Box empirically: As a rule of thumb, if a component explains more than 5-10% of the variance of the averaged EKG signal, the component is included. Note that the number of components you select can also be changed when the coefficients are applied to the raw data.&lt;br /&gt;
&lt;br /&gt;
== Correcting the raw data ==&lt;br /&gt;
&lt;br /&gt;
* Switch back to the raw data file, and load the ''*.atf'' file you have created ('''Artifact/Load…''').&lt;br /&gt;
* Optionally, check that the artifact correction channels are visible (Artifact/View)&lt;br /&gt;
* Switch on artifact correction (Artifact/Correct).&lt;br /&gt;
* The figure on the next page shows the result of correction of channels A75-A148 on a three-second interval containing both EKG and eye activity. The blue label “1” marks the onset of a blink found during pattern search. The red “2” shows the onset of R-waves found during pattern search.&lt;br /&gt;
* Note that correction is quite good, but it is not perfect. In particular, there is some residual eye activity, e.g. around channels A91, A113, A131.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! '''uncorrected'''&lt;br /&gt;
! '''corrected'''&lt;br /&gt;
|-&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(4).png|57x57px]][[File:EKG_artifacts_in_MEG_data__(5).png|272x802px]]&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(6).png|273x801px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Averaging the raw data ==&lt;br /&gt;
&lt;br /&gt;
You can leave correction on during data averaging. When you press the Average button, a warning dialog will appear:&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(7).png|539x124px]]&lt;br /&gt;
&lt;br /&gt;
You may select either option. Because of the recent installation of subspace projection (SSP) in the Source Module, the “distorted topographies” in the warning are no longer an issue for source analysis, provided SSP is switched on when the data are sent to the Source Module. The decision has consequences a) if you intend to analyze data waveform amplitudes and/or latencies, and b) if you intend to export the averages for analysis with other software.&lt;br /&gt;
&lt;br /&gt;
==== Option “Yes” – turn off artifact correction ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will include EKG and eye artifacts, but these artifacts will not cause epochs to be rejected. The same number of epochs will be included in the average whether or not “Yes” or “No” is chosen.&lt;br /&gt;
&lt;br /&gt;
You may load the correction coefficients (''*.atf'') for the average, and switch on artifact correction.&lt;br /&gt;
&lt;br /&gt;
==== Option “No” – leave artifact correction on ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will be corrected. Each epoch is corrected before being included in the average.&lt;br /&gt;
&lt;br /&gt;
==== Artifact options: which correction model? ====&lt;br /&gt;
&lt;br /&gt;
The result of the correction on the raw data or the averaged data can be slightly different. The effects of correction will also vary, depending on the settings in '''Artifact/Options'''. These differences can be considered as consequences of variations in the “surrogate” or “adaptive” model of brain activity concurrent with the artifact activity (cf. Berg &amp;amp;amp; Scherg 1994). These differences lead to changes in the estimate of the amounts of artifact activity to be removed by correction. If you intend to use the data waveforms outside BESA, and if you don’t use SSP with the artifact coefficients, then the settings in '''Artifact/Options''' become important. In current versions of BESA, these settings are based on EEG amplitude levels. We generally use the values shown on the right. Note that these values are '''irrelevant''' if we use SSP in Source Analysis.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(8).png|353x231px]]&lt;br /&gt;
&lt;br /&gt;
== Sending the data to Source Analysis ==&lt;br /&gt;
&lt;br /&gt;
When the average is generated, the correction coefficients are saved in the ''*.fsg'' file. Before you send the data to the Source Module, these coefficients must be '''activated'''.&lt;br /&gt;
&lt;br /&gt;
* If you averaged the corrected data, coefficients are already activated. This should be apparent from the red “corrected” displayed above the channel labels.&lt;br /&gt;
* If you averaged the uncorrected data, load the saved ''*.atf'' file ('''Artifact/Load…'''), and switch on correction ('''Artifact/Correct''').&lt;br /&gt;
&lt;br /&gt;
Then mark a time range and send the data to Source Analysis. At the right of the status bar, the text '''ART''' indicates that the artifact components are used in SSP.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(9).png|143x158px]]&lt;br /&gt;
&lt;br /&gt;
'''Alternatively, if you averaged the uncorrected data, load the average to Source Analysis, and then load the artifact coefficients as part of the dipole model (load or append solution, and use the dropdown list in the File Open box to select ''*.atf'' instead of ''*.bsa''). This approach has the advantage that the source waveforms of the spatial components show the contribution of eye and EKG activity to the model.'''&lt;br /&gt;
&lt;br /&gt;
This implicit application of SSP during Source Analysis is mathematically equivalent to the “optimizing” correction method (cf. Berg &amp;amp;amp; Scherg 1994): the topographies of the artifacts are implicitly incorporated into any dipole model.&lt;br /&gt;
&lt;br /&gt;
== Limitations of the correction method in BESA ==&lt;br /&gt;
&lt;br /&gt;
=== Bad channels ===&lt;br /&gt;
&lt;br /&gt;
The ''*.atf'' file contains a two-line header with a) the number of channels, and b) the channel labels. If these do not match with the current data file, artifact correction is not possible. Bad channels are marked (with an asterisk next to the label), and the corresponding coefficient is set to zero. The irritating, but logical, the consequence is that if a channel was excluded (defined as “bad”) when the coefficients were generated, it is not possible to make the channel “good” again.&lt;br /&gt;
&lt;br /&gt;
The solution is to regenerate the ''*.atf'' file, making sure the same bad channels are defined in the averaged artifact file as the to-be-corrected raw or average data file. You do not need to regenerate the artifact averages.&lt;br /&gt;
&lt;br /&gt;
EKG correction is difficult because the topographic distribution of EKG signals is close to some MEG distributions: for instance, we sometimes observe a considerable reduction in alpha amplitudes with EKG correction. For event-related averaging, an EKG correction is often unnecessary, because the EKG is not synchronized with the stimulus.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Data Import/Export]] [[Category:Preprocessing]] [[Category:Source Analysis]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data</id>
		<title>Using BESA to correct blink and EKG artifacts in MEG data</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data"/>
				<updated>2021-02-02T11:57:01Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* EKG */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Standard or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using BESA to correct blink and EKG artifacts in MEG data =&lt;br /&gt;
&lt;br /&gt;
Eyeblinks and EKG cause large artifact signals in the magnetometer channels. The artifact correction facilities of BESA can correct these artifacts quite well. The procedure is quite simple for blinks but more complex for EKG. The following text outlines the procedures and current limitations of BESA for artifact correction.&lt;br /&gt;
&lt;br /&gt;
The principles of the artifact correction procedure are described in ''Berg, P., Scherg, M. (1994) A multiple source approach to the correction of eye artifacts. Electroenceph. clin. Neurophysiol, 90: 229-241''.&lt;br /&gt;
&lt;br /&gt;
In summary, the following steps are required:&lt;br /&gt;
&lt;br /&gt;
* Use pattern search and average to identify the latencies of blink/EKG signals in the raw data. Pattern search works best if you have recorded a vertical EOG and EKG with the MEG data, but it will also work on selected MEG channels, using the appropriate filters.&lt;br /&gt;
* A spatial PCA is performed on the average to identify the main topographies/components of the artifact signal. For blinks, only one topography is required. For EKG, two or three topographies may be required.&lt;br /&gt;
* The topographies/components are combined into a coefficient file (''*.atf''). Using the '''Artifact''' Menu, the ''atf'' file can be loaded and correction switched on. Contrary to the warning message displayed by the ERP module, averaging can be performed using artifact corrected data.&lt;br /&gt;
* When the average is loaded into the Source Analysis module, the artifact coefficients (saved in the average file) need to be activated. They will then be incorporated into source modelling using subspace projection (SSP – see also papers by Uusitalo et al.). In this case, SSP is equivalent to the “optimized correction method” described in Berg &amp;amp;amp; Scherg (1994).&lt;br /&gt;
&lt;br /&gt;
== Pattern search for blinks and EKG ==&lt;br /&gt;
&lt;br /&gt;
=== Eyeblinks ===&lt;br /&gt;
&lt;br /&gt;
# Select filters 0.5 – 8 Hz ('''Filters/Edit Filter Settings…'''). Make sure the low cutoff filter type is '''Forward'''! (This is to ensure that no contribution from the blink topography bleeds back into the baseline time interval).&lt;br /&gt;
# View Polygraphic signals only (press the '''Pgr''' button at the top right of the BESA window), so that the vertical EOG channel is displayed&lt;br /&gt;
# Define the search block from –100 ms to +400 ms ('''Edit/Default Block Epoch…''')&lt;br /&gt;
# Select Pattern Search ('''Search/Pattern''')&lt;br /&gt;
# Select Search Query ('''Search/Query''')&lt;br /&gt;
# Select Buffer 1 for averaging ('''Tags/Pattern 1''')&lt;br /&gt;
# Identify a clear blink signal on the vertical EOG channel. Right-click at the '''onset''' of the blink, and select '''Default Block''' in the dropdown menu. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(1).png|75x55px]]&lt;br /&gt;
# Click once on the VEOG channel label, so that a rightward arrow is displayed (ignore the correlation window that opens on the right): [[File:EKG_artifacts_in_MEG_data__(2).png|100x55px]]&lt;br /&gt;
# Press the '''SAW''' button (Search/Average/Write). BESA will start scanning through the file, and it will stop at each occurrence of a blink. Press “Yes” to accept. “No” to reject, or “Stop asking” to let BESA accept everything automatically. Save the result to a file name of your choice (e.g. ''name_artifact.fsg''), labelling the segment, e.g. “blink”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
# In contrast to blink averaging we use two steps: first, filters are set to enhance the EKG for pattern search. Second, the filters are opened up, and the average is repeated.&lt;br /&gt;
# Select filters 5-20 Hz. This should generate a fairly clear signal on the EKG.&lt;br /&gt;
# Set the default block epoch so that the R-wave and the T-wave are well inside the epoch. The setting used for blinks may be OK, but you may need to extend the post-cursor interval, e.g. from 400 to 500 ms.&lt;br /&gt;
# Proceed as with blinks, but selecting Buffer 2 for averaging ('''Tags/Pattern 2'''). Mark a block around the onset of an R-wave. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(3).png|100x56px]]&lt;br /&gt;
# Save the average in the same file as the averaged blinks, labelling the segment, e.g. “EKG”.&lt;br /&gt;
# Select filters 1-30 Hz. Select '''Search/Tagged Events''', and press '''SAW'''. This repeats the average using the tags that were identified during the first step. Opening up the filters ensures that the average includes more of the EKG signal.&lt;br /&gt;
&lt;br /&gt;
=== What to do if there is no VEOG or EKG channel ===&lt;br /&gt;
&lt;br /&gt;
The procedure is similar to the above, but you need to identify a MEG channel that displays the blink or EKG waveform clearly. You may need to experiment with filter settings to make the artifact pattern clearer (the filter settings described above are not fixed rules – you may find that other settings work better for pattern search). You may find the “Create Triggers from EMG/EEG” tool helpful for detecting EKG ('''ERP/Create Triggers from EMG/EEG…'''). See the BESA help file (tutorial on creating triggers).&lt;br /&gt;
&lt;br /&gt;
== Spatial PCA and the *.atf file ==&lt;br /&gt;
&lt;br /&gt;
Open the file in which you saved the averages (e.g. ''name_artifact.fsg''). Make sure that prestimulus baseline correction is switched on ('''Filters/Use Prestimulus Baseline''').&lt;br /&gt;
&lt;br /&gt;
=== Blinks ===&lt;br /&gt;
&lt;br /&gt;
# Mark the whole blink epoch: Right-click onto the epoch, and select '''Whole Segment'''.&lt;br /&gt;
# Select '''Artifact/Assign/Blink'''. The spatial PCA is computed, and the first spatial component is assigned to describe the blink. You may check if the correction works by selecting '''Artifact/Correct'''.&lt;br /&gt;
# The coefficients are saved automatically to a file with the same basename as the average, and the extension ''“.atf''”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
EKG coefficients are corrected analogously to blinks. A difference is that the topographic distribution of the EKG over the MEG sensors is more complex than that of blinks. It changes over time. The reasons for this are unclear, and may be due to movement of the heart (and its equivalent dipoles) over time, but also to ballistic effects: movement of the head due to blood flow.&lt;br /&gt;
&lt;br /&gt;
Since topographic distribution changes over time, more than one component is required for correction. We choose the number of components in the Artifact Select Dialog Box empirically: As a rule of thumb, if a component explains more than 5-10% of the variance of the averaged EKG signal, the component is included. Note that the number of components you select can also be changed when the coefficients are applied to the raw data.&lt;br /&gt;
&lt;br /&gt;
== Correcting the raw data ==&lt;br /&gt;
&lt;br /&gt;
* Switch back to the raw data file, and load the ''*.atf'' file you have created ('''Artifact/Load…''').&lt;br /&gt;
* Optionally, check that the artifact correction channels are visible (Artifact/View)&lt;br /&gt;
* Switch on artifact correction (Artifact/Correct).&lt;br /&gt;
* The figure on the next page shows the result of correction of channels A75-A148 on a three-second interval containing both EKG and eye activity. The blue label “1” marks the onset of a blink found during pattern search. The red “2” shows the onset of R-waves found during pattern search.&lt;br /&gt;
* Note that correction is quite good, but it is not perfect. In particular, there is some residual eye activity, e.g. around channels A91, A113, A131.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! '''uncorrected'''&lt;br /&gt;
! '''corrected'''&lt;br /&gt;
|-&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(4).png|57x57px]][[File:EKG_artifacts_in_MEG_data__(5).png|272x802px]]&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(6).png|273x801px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Averaging the raw data ==&lt;br /&gt;
&lt;br /&gt;
You can leave correction on during data averaging. When you press the Average button, a warning dialog will appear:&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(7).png|539x124px]]&lt;br /&gt;
&lt;br /&gt;
You may select either option. Because of the recent installation of subspace projection (SSP) in the Source Module, the “distorted topographies” in the warning are no longer an issue for source analysis, provided SSP is switched on when the data are sent to the Source Module. The decision has consequences a) if you intend to analyze data waveform amplitudes and/or latencies, and b) if you intend to export the averages for analysis with other software.&lt;br /&gt;
&lt;br /&gt;
==== Option “Yes” – turn off artifact correction ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will include EKG and eye artifacts, but these artifacts will not cause epochs to be rejected. The same number of epochs will be included in the average whether or not “Yes” or “No” is chosen.&lt;br /&gt;
&lt;br /&gt;
You may load the correction coefficients (''*.atf'') for the average, and switch on artifact correction.&lt;br /&gt;
&lt;br /&gt;
==== Option “No” – leave artifact correction on ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will be corrected. Each epoch is corrected before being included in the average.&lt;br /&gt;
&lt;br /&gt;
==== Artifact options: which correction model? ====&lt;br /&gt;
&lt;br /&gt;
The result of the correction on the raw data or the averaged data can be slightly different. The effects of correction will also vary, depending on the settings in '''Artifact/Options'''. These differences can be considered as consequences of variations in the “surrogate” or “adaptive” model of brain activity concurrent with the artifact activity (cf. Berg &amp;amp;amp; Scherg 1994). These differences lead to changes in the estimate of the amounts of artifact activity to be removed by correction. If you intend to use the data waveforms outside BESA, and if you don’t use SSP with the artifact coefficients, then the settings in '''Artifact/Options''' become important. In current versions of BESA, these settings are based on EEG amplitude levels. In Konstanz, we generally use the values shown on the right. Note that these values are '''irrelevant''' if we use SSP in Source Analysis.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(8).png|353x231px]]&lt;br /&gt;
&lt;br /&gt;
== Sending the data to Source Analysis ==&lt;br /&gt;
&lt;br /&gt;
When the average is generated, the correction coefficients are saved in the ''*.fsg'' file. Before you send the data to the Source Module, these coefficients must be '''activated'''.&lt;br /&gt;
&lt;br /&gt;
* If you averaged the corrected data, coefficients are already activated. This should be apparent from the red “corrected” displayed above the channel labels.&lt;br /&gt;
* If you averaged the uncorrected data, load the saved ''*.atf'' file ('''Artifact/Load…'''), and switch on correction ('''Artifact/Correct''').&lt;br /&gt;
&lt;br /&gt;
Then mark a time range and send the data to Source Analysis. At the right of the status bar, the text '''ART''' indicates that the artifact components are used in SSP.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(9).png|143x158px]]&lt;br /&gt;
&lt;br /&gt;
'''Alternatively, if you averaged the uncorrected data, load the average to Source Analysis, and then load the artifact coefficients as part of the dipole model (load or append solution, and use the dropdown list in the File Open box to select ''*.atf'' instead of ''*.bsa''). This approach has the advantage that the source waveforms of the spatial components show the contribution of eye and EKG activity to the model.'''&lt;br /&gt;
&lt;br /&gt;
This implicit application of SSP during Source Analysis is mathematically equivalent to the “optimizing” correction method (cf. Berg &amp;amp;amp; Scherg 1994): the topographies of the artifacts are implicitly incorporated into any dipole model.&lt;br /&gt;
&lt;br /&gt;
== Limitations of the correction method in BESA ==&lt;br /&gt;
&lt;br /&gt;
=== Bad channels ===&lt;br /&gt;
&lt;br /&gt;
The ''*.atf'' file contains a two-line header with a) the number of channels, and b) the channel labels. If these do not match with the current data file, artifact correction is not possible. Bad channels are marked (with an asterisk next to the label), and the corresponding coefficient is set to zero. The irritating, but logical, the consequence is that if a channel was excluded (defined as “bad”) when the coefficients were generated, it is not possible to make the channel “good” again.&lt;br /&gt;
&lt;br /&gt;
The solution is to regenerate the ''*.atf'' file, making sure the same bad channels are defined in the averaged artifact file as the to-be-corrected raw or average data file. You do not need to regenerate the artifact averages.&lt;br /&gt;
&lt;br /&gt;
EKG correction is difficult because the topographic distribution of EKG signals is close to some MEG distributions: for instance, we sometimes observe a considerable reduction in alpha amplitudes with EKG correction. For event-related averaging, an EKG correction is often unnecessary, because the EKG is not synchronized with the stimulus.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Data Import/Export]] [[Category:Preprocessing]] [[Category:Source Analysis]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data</id>
		<title>Using BESA to correct blink and EKG artifacts in MEG data</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data"/>
				<updated>2021-02-02T11:56:44Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* Eyeblinks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Standard or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using BESA to correct blink and EKG artifacts in MEG data =&lt;br /&gt;
&lt;br /&gt;
Eyeblinks and EKG cause large artifact signals in the magnetometer channels. The artifact correction facilities of BESA can correct these artifacts quite well. The procedure is quite simple for blinks but more complex for EKG. The following text outlines the procedures and current limitations of BESA for artifact correction.&lt;br /&gt;
&lt;br /&gt;
The principles of the artifact correction procedure are described in ''Berg, P., Scherg, M. (1994) A multiple source approach to the correction of eye artifacts. Electroenceph. clin. Neurophysiol, 90: 229-241''.&lt;br /&gt;
&lt;br /&gt;
In summary, the following steps are required:&lt;br /&gt;
&lt;br /&gt;
* Use pattern search and average to identify the latencies of blink/EKG signals in the raw data. Pattern search works best if you have recorded a vertical EOG and EKG with the MEG data, but it will also work on selected MEG channels, using the appropriate filters.&lt;br /&gt;
* A spatial PCA is performed on the average to identify the main topographies/components of the artifact signal. For blinks, only one topography is required. For EKG, two or three topographies may be required.&lt;br /&gt;
* The topographies/components are combined into a coefficient file (''*.atf''). Using the '''Artifact''' Menu, the ''atf'' file can be loaded and correction switched on. Contrary to the warning message displayed by the ERP module, averaging can be performed using artifact corrected data.&lt;br /&gt;
* When the average is loaded into the Source Analysis module, the artifact coefficients (saved in the average file) need to be activated. They will then be incorporated into source modelling using subspace projection (SSP – see also papers by Uusitalo et al.). In this case, SSP is equivalent to the “optimized correction method” described in Berg &amp;amp;amp; Scherg (1994).&lt;br /&gt;
&lt;br /&gt;
== Pattern search for blinks and EKG ==&lt;br /&gt;
&lt;br /&gt;
=== Eyeblinks ===&lt;br /&gt;
&lt;br /&gt;
# Select filters 0.5 – 8 Hz ('''Filters/Edit Filter Settings…'''). Make sure the low cutoff filter type is '''Forward'''! (This is to ensure that no contribution from the blink topography bleeds back into the baseline time interval).&lt;br /&gt;
# View Polygraphic signals only (press the '''Pgr''' button at the top right of the BESA window), so that the vertical EOG channel is displayed&lt;br /&gt;
# Define the search block from –100 ms to +400 ms ('''Edit/Default Block Epoch…''')&lt;br /&gt;
# Select Pattern Search ('''Search/Pattern''')&lt;br /&gt;
# Select Search Query ('''Search/Query''')&lt;br /&gt;
# Select Buffer 1 for averaging ('''Tags/Pattern 1''')&lt;br /&gt;
# Identify a clear blink signal on the vertical EOG channel. Right-click at the '''onset''' of the blink, and select '''Default Block''' in the dropdown menu. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(1).png|75x55px]]&lt;br /&gt;
# Click once on the VEOG channel label, so that a rightward arrow is displayed (ignore the correlation window that opens on the right): [[File:EKG_artifacts_in_MEG_data__(2).png|100x55px]]&lt;br /&gt;
# Press the '''SAW''' button (Search/Average/Write). BESA will start scanning through the file, and it will stop at each occurrence of a blink. Press “Yes” to accept. “No” to reject, or “Stop asking” to let BESA accept everything automatically. Save the result to a file name of your choice (e.g. ''name_artifact.fsg''), labelling the segment, e.g. “blink”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
# In contrast to blink averaging we use two steps: first, filters are set to enhance the EKG for pattern search. Second, the filters are opened up, and the average is repeated.&lt;br /&gt;
# Select filters 5-20 Hz. This should generate a fairly clear signal on the EKG.&lt;br /&gt;
# Set the default block epoch so that the R-wave and the T-wave are well inside the epoch. The setting used for blinks may be OK, but you may need to extend the post-cursor interval, e.g. from 400 to 500 ms.&lt;br /&gt;
# Proceed as with blinks, but selecting Buffer 2 for averaging ('''Tags/Pattern 2'''). Mark a block around the onset of an R-wave. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(3).png|129x89px]]&lt;br /&gt;
# Save the average in the same file as the averaged blinks, labelling the segment, e.g. “EKG”.&lt;br /&gt;
# Select filters 1-30 Hz. Select '''Search/Tagged Events''', and press '''SAW'''. This repeats the average using the tags that were identified during the first step. Opening up the filters ensures that the average includes more of the EKG signal.&lt;br /&gt;
&lt;br /&gt;
=== What to do if there is no VEOG or EKG channel ===&lt;br /&gt;
&lt;br /&gt;
The procedure is similar to the above, but you need to identify a MEG channel that displays the blink or EKG waveform clearly. You may need to experiment with filter settings to make the artifact pattern clearer (the filter settings described above are not fixed rules – you may find that other settings work better for pattern search). You may find the “Create Triggers from EMG/EEG” tool helpful for detecting EKG ('''ERP/Create Triggers from EMG/EEG…'''). See the BESA help file (tutorial on creating triggers).&lt;br /&gt;
&lt;br /&gt;
== Spatial PCA and the *.atf file ==&lt;br /&gt;
&lt;br /&gt;
Open the file in which you saved the averages (e.g. ''name_artifact.fsg''). Make sure that prestimulus baseline correction is switched on ('''Filters/Use Prestimulus Baseline''').&lt;br /&gt;
&lt;br /&gt;
=== Blinks ===&lt;br /&gt;
&lt;br /&gt;
# Mark the whole blink epoch: Right-click onto the epoch, and select '''Whole Segment'''.&lt;br /&gt;
# Select '''Artifact/Assign/Blink'''. The spatial PCA is computed, and the first spatial component is assigned to describe the blink. You may check if the correction works by selecting '''Artifact/Correct'''.&lt;br /&gt;
# The coefficients are saved automatically to a file with the same basename as the average, and the extension ''“.atf''”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
EKG coefficients are corrected analogously to blinks. A difference is that the topographic distribution of the EKG over the MEG sensors is more complex than that of blinks. It changes over time. The reasons for this are unclear, and may be due to movement of the heart (and its equivalent dipoles) over time, but also to ballistic effects: movement of the head due to blood flow.&lt;br /&gt;
&lt;br /&gt;
Since topographic distribution changes over time, more than one component is required for correction. We choose the number of components in the Artifact Select Dialog Box empirically: As a rule of thumb, if a component explains more than 5-10% of the variance of the averaged EKG signal, the component is included. Note that the number of components you select can also be changed when the coefficients are applied to the raw data.&lt;br /&gt;
&lt;br /&gt;
== Correcting the raw data ==&lt;br /&gt;
&lt;br /&gt;
* Switch back to the raw data file, and load the ''*.atf'' file you have created ('''Artifact/Load…''').&lt;br /&gt;
* Optionally, check that the artifact correction channels are visible (Artifact/View)&lt;br /&gt;
* Switch on artifact correction (Artifact/Correct).&lt;br /&gt;
* The figure on the next page shows the result of correction of channels A75-A148 on a three-second interval containing both EKG and eye activity. The blue label “1” marks the onset of a blink found during pattern search. The red “2” shows the onset of R-waves found during pattern search.&lt;br /&gt;
* Note that correction is quite good, but it is not perfect. In particular, there is some residual eye activity, e.g. around channels A91, A113, A131.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! '''uncorrected'''&lt;br /&gt;
! '''corrected'''&lt;br /&gt;
|-&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(4).png|57x57px]][[File:EKG_artifacts_in_MEG_data__(5).png|272x802px]]&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(6).png|273x801px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Averaging the raw data ==&lt;br /&gt;
&lt;br /&gt;
You can leave correction on during data averaging. When you press the Average button, a warning dialog will appear:&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(7).png|539x124px]]&lt;br /&gt;
&lt;br /&gt;
You may select either option. Because of the recent installation of subspace projection (SSP) in the Source Module, the “distorted topographies” in the warning are no longer an issue for source analysis, provided SSP is switched on when the data are sent to the Source Module. The decision has consequences a) if you intend to analyze data waveform amplitudes and/or latencies, and b) if you intend to export the averages for analysis with other software.&lt;br /&gt;
&lt;br /&gt;
==== Option “Yes” – turn off artifact correction ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will include EKG and eye artifacts, but these artifacts will not cause epochs to be rejected. The same number of epochs will be included in the average whether or not “Yes” or “No” is chosen.&lt;br /&gt;
&lt;br /&gt;
You may load the correction coefficients (''*.atf'') for the average, and switch on artifact correction.&lt;br /&gt;
&lt;br /&gt;
==== Option “No” – leave artifact correction on ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will be corrected. Each epoch is corrected before being included in the average.&lt;br /&gt;
&lt;br /&gt;
==== Artifact options: which correction model? ====&lt;br /&gt;
&lt;br /&gt;
The result of the correction on the raw data or the averaged data can be slightly different. The effects of correction will also vary, depending on the settings in '''Artifact/Options'''. These differences can be considered as consequences of variations in the “surrogate” or “adaptive” model of brain activity concurrent with the artifact activity (cf. Berg &amp;amp;amp; Scherg 1994). These differences lead to changes in the estimate of the amounts of artifact activity to be removed by correction. If you intend to use the data waveforms outside BESA, and if you don’t use SSP with the artifact coefficients, then the settings in '''Artifact/Options''' become important. In current versions of BESA, these settings are based on EEG amplitude levels. In Konstanz, we generally use the values shown on the right. Note that these values are '''irrelevant''' if we use SSP in Source Analysis.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(8).png|353x231px]]&lt;br /&gt;
&lt;br /&gt;
== Sending the data to Source Analysis ==&lt;br /&gt;
&lt;br /&gt;
When the average is generated, the correction coefficients are saved in the ''*.fsg'' file. Before you send the data to the Source Module, these coefficients must be '''activated'''.&lt;br /&gt;
&lt;br /&gt;
* If you averaged the corrected data, coefficients are already activated. This should be apparent from the red “corrected” displayed above the channel labels.&lt;br /&gt;
* If you averaged the uncorrected data, load the saved ''*.atf'' file ('''Artifact/Load…'''), and switch on correction ('''Artifact/Correct''').&lt;br /&gt;
&lt;br /&gt;
Then mark a time range and send the data to Source Analysis. At the right of the status bar, the text '''ART''' indicates that the artifact components are used in SSP.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(9).png|143x158px]]&lt;br /&gt;
&lt;br /&gt;
'''Alternatively, if you averaged the uncorrected data, load the average to Source Analysis, and then load the artifact coefficients as part of the dipole model (load or append solution, and use the dropdown list in the File Open box to select ''*.atf'' instead of ''*.bsa''). This approach has the advantage that the source waveforms of the spatial components show the contribution of eye and EKG activity to the model.'''&lt;br /&gt;
&lt;br /&gt;
This implicit application of SSP during Source Analysis is mathematically equivalent to the “optimizing” correction method (cf. Berg &amp;amp;amp; Scherg 1994): the topographies of the artifacts are implicitly incorporated into any dipole model.&lt;br /&gt;
&lt;br /&gt;
== Limitations of the correction method in BESA ==&lt;br /&gt;
&lt;br /&gt;
=== Bad channels ===&lt;br /&gt;
&lt;br /&gt;
The ''*.atf'' file contains a two-line header with a) the number of channels, and b) the channel labels. If these do not match with the current data file, artifact correction is not possible. Bad channels are marked (with an asterisk next to the label), and the corresponding coefficient is set to zero. The irritating, but logical, the consequence is that if a channel was excluded (defined as “bad”) when the coefficients were generated, it is not possible to make the channel “good” again.&lt;br /&gt;
&lt;br /&gt;
The solution is to regenerate the ''*.atf'' file, making sure the same bad channels are defined in the averaged artifact file as the to-be-corrected raw or average data file. You do not need to regenerate the artifact averages.&lt;br /&gt;
&lt;br /&gt;
EKG correction is difficult because the topographic distribution of EKG signals is close to some MEG distributions: for instance, we sometimes observe a considerable reduction in alpha amplitudes with EKG correction. For event-related averaging, an EKG correction is often unnecessary, because the EKG is not synchronized with the stimulus.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Data Import/Export]] [[Category:Preprocessing]] [[Category:Source Analysis]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data</id>
		<title>Using BESA to correct blink and EKG artifacts in MEG data</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data"/>
				<updated>2021-02-02T11:55:20Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* Pattern search for blinks and EKG */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Standard or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using BESA to correct blink and EKG artifacts in MEG data =&lt;br /&gt;
&lt;br /&gt;
Eyeblinks and EKG cause large artifact signals in the magnetometer channels. The artifact correction facilities of BESA can correct these artifacts quite well. The procedure is quite simple for blinks but more complex for EKG. The following text outlines the procedures and current limitations of BESA for artifact correction.&lt;br /&gt;
&lt;br /&gt;
The principles of the artifact correction procedure are described in ''Berg, P., Scherg, M. (1994) A multiple source approach to the correction of eye artifacts. Electroenceph. clin. Neurophysiol, 90: 229-241''.&lt;br /&gt;
&lt;br /&gt;
In summary, the following steps are required:&lt;br /&gt;
&lt;br /&gt;
* Use pattern search and average to identify the latencies of blink/EKG signals in the raw data. Pattern search works best if you have recorded a vertical EOG and EKG with the MEG data, but it will also work on selected MEG channels, using the appropriate filters.&lt;br /&gt;
* A spatial PCA is performed on the average to identify the main topographies/components of the artifact signal. For blinks, only one topography is required. For EKG, two or three topographies may be required.&lt;br /&gt;
* The topographies/components are combined into a coefficient file (''*.atf''). Using the '''Artifact''' Menu, the ''atf'' file can be loaded and correction switched on. Contrary to the warning message displayed by the ERP module, averaging can be performed using artifact corrected data.&lt;br /&gt;
* When the average is loaded into the Source Analysis module, the artifact coefficients (saved in the average file) need to be activated. They will then be incorporated into source modelling using subspace projection (SSP – see also papers by Uusitalo et al.). In this case, SSP is equivalent to the “optimized correction method” described in Berg &amp;amp;amp; Scherg (1994).&lt;br /&gt;
&lt;br /&gt;
== Pattern search for blinks and EKG ==&lt;br /&gt;
&lt;br /&gt;
=== Eyeblinks ===&lt;br /&gt;
&lt;br /&gt;
# Select filters 0.5 – 8 Hz ('''Filters/Edit Filter Settings…'''). Make sure the low cutoff filter type is '''Forward'''! (This is to ensure that no contribution from the blink topography bleeds back into the baseline time interval).&lt;br /&gt;
# View Polygraphic signals only (press the '''Pgr''' button at the top right of the BESA window), so that the vertical EOG channel is displayed&lt;br /&gt;
# Define the search block from –100 ms to +400 ms ('''Edit/Default Block Epoch…''')&lt;br /&gt;
# Select Pattern Search ('''Search/Pattern''')&lt;br /&gt;
# Select Search Query ('''Search/Query''')&lt;br /&gt;
# Select Buffer 1 for averaging ('''Tags/Pattern 1''')&lt;br /&gt;
# Identify a clear blink signal on the vertical EOG channel. Right-click at the '''onset''' of the blink, and select '''Default Block''' in the dropdown menu. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(1).png|100x75px]]&lt;br /&gt;
# Click once on the VEOG channel label, so that a rightward arrow is displayed (ignore the correlation window that opens on the right): [[File:EKG_artifacts_in_MEG_data__(2).png|100x55px]]&lt;br /&gt;
# Press the '''SAW''' button (Search/Average/Write). BESA will start scanning through the file, and it will stop at each occurrence of a blink. Press “Yes” to accept. “No” to reject, or “Stop asking” to let BESA accept everything automatically. Save the result to a file name of your choice (e.g. ''name_artifact.fsg''), labelling the segment, e.g. “blink”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
# In contrast to blink averaging we use two steps: first, filters are set to enhance the EKG for pattern search. Second, the filters are opened up, and the average is repeated.&lt;br /&gt;
# Select filters 5-20 Hz. This should generate a fairly clear signal on the EKG.&lt;br /&gt;
# Set the default block epoch so that the R-wave and the T-wave are well inside the epoch. The setting used for blinks may be OK, but you may need to extend the post-cursor interval, e.g. from 400 to 500 ms.&lt;br /&gt;
# Proceed as with blinks, but selecting Buffer 2 for averaging ('''Tags/Pattern 2'''). Mark a block around the onset of an R-wave. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(3).png|129x89px]]&lt;br /&gt;
# Save the average in the same file as the averaged blinks, labelling the segment, e.g. “EKG”.&lt;br /&gt;
# Select filters 1-30 Hz. Select '''Search/Tagged Events''', and press '''SAW'''. This repeats the average using the tags that were identified during the first step. Opening up the filters ensures that the average includes more of the EKG signal.&lt;br /&gt;
&lt;br /&gt;
=== What to do if there is no VEOG or EKG channel ===&lt;br /&gt;
&lt;br /&gt;
The procedure is similar to the above, but you need to identify a MEG channel that displays the blink or EKG waveform clearly. You may need to experiment with filter settings to make the artifact pattern clearer (the filter settings described above are not fixed rules – you may find that other settings work better for pattern search). You may find the “Create Triggers from EMG/EEG” tool helpful for detecting EKG ('''ERP/Create Triggers from EMG/EEG…'''). See the BESA help file (tutorial on creating triggers).&lt;br /&gt;
&lt;br /&gt;
== Spatial PCA and the *.atf file ==&lt;br /&gt;
&lt;br /&gt;
Open the file in which you saved the averages (e.g. ''name_artifact.fsg''). Make sure that prestimulus baseline correction is switched on ('''Filters/Use Prestimulus Baseline''').&lt;br /&gt;
&lt;br /&gt;
=== Blinks ===&lt;br /&gt;
&lt;br /&gt;
# Mark the whole blink epoch: Right-click onto the epoch, and select '''Whole Segment'''.&lt;br /&gt;
# Select '''Artifact/Assign/Blink'''. The spatial PCA is computed, and the first spatial component is assigned to describe the blink. You may check if the correction works by selecting '''Artifact/Correct'''.&lt;br /&gt;
# The coefficients are saved automatically to a file with the same basename as the average, and the extension ''“.atf''”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
EKG coefficients are corrected analogously to blinks. A difference is that the topographic distribution of the EKG over the MEG sensors is more complex than that of blinks. It changes over time. The reasons for this are unclear, and may be due to movement of the heart (and its equivalent dipoles) over time, but also to ballistic effects: movement of the head due to blood flow.&lt;br /&gt;
&lt;br /&gt;
Since topographic distribution changes over time, more than one component is required for correction. We choose the number of components in the Artifact Select Dialog Box empirically: As a rule of thumb, if a component explains more than 5-10% of the variance of the averaged EKG signal, the component is included. Note that the number of components you select can also be changed when the coefficients are applied to the raw data.&lt;br /&gt;
&lt;br /&gt;
== Correcting the raw data ==&lt;br /&gt;
&lt;br /&gt;
* Switch back to the raw data file, and load the ''*.atf'' file you have created ('''Artifact/Load…''').&lt;br /&gt;
* Optionally, check that the artifact correction channels are visible (Artifact/View)&lt;br /&gt;
* Switch on artifact correction (Artifact/Correct).&lt;br /&gt;
* The figure on the next page shows the result of correction of channels A75-A148 on a three-second interval containing both EKG and eye activity. The blue label “1” marks the onset of a blink found during pattern search. The red “2” shows the onset of R-waves found during pattern search.&lt;br /&gt;
* Note that correction is quite good, but it is not perfect. In particular, there is some residual eye activity, e.g. around channels A91, A113, A131.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! '''uncorrected'''&lt;br /&gt;
! '''corrected'''&lt;br /&gt;
|-&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(4).png|57x57px]][[File:EKG_artifacts_in_MEG_data__(5).png|272x802px]]&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(6).png|273x801px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Averaging the raw data ==&lt;br /&gt;
&lt;br /&gt;
You can leave correction on during data averaging. When you press the Average button, a warning dialog will appear:&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(7).png|539x124px]]&lt;br /&gt;
&lt;br /&gt;
You may select either option. Because of the recent installation of subspace projection (SSP) in the Source Module, the “distorted topographies” in the warning are no longer an issue for source analysis, provided SSP is switched on when the data are sent to the Source Module. The decision has consequences a) if you intend to analyze data waveform amplitudes and/or latencies, and b) if you intend to export the averages for analysis with other software.&lt;br /&gt;
&lt;br /&gt;
==== Option “Yes” – turn off artifact correction ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will include EKG and eye artifacts, but these artifacts will not cause epochs to be rejected. The same number of epochs will be included in the average whether or not “Yes” or “No” is chosen.&lt;br /&gt;
&lt;br /&gt;
You may load the correction coefficients (''*.atf'') for the average, and switch on artifact correction.&lt;br /&gt;
&lt;br /&gt;
==== Option “No” – leave artifact correction on ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will be corrected. Each epoch is corrected before being included in the average.&lt;br /&gt;
&lt;br /&gt;
==== Artifact options: which correction model? ====&lt;br /&gt;
&lt;br /&gt;
The result of the correction on the raw data or the averaged data can be slightly different. The effects of correction will also vary, depending on the settings in '''Artifact/Options'''. These differences can be considered as consequences of variations in the “surrogate” or “adaptive” model of brain activity concurrent with the artifact activity (cf. Berg &amp;amp;amp; Scherg 1994). These differences lead to changes in the estimate of the amounts of artifact activity to be removed by correction. If you intend to use the data waveforms outside BESA, and if you don’t use SSP with the artifact coefficients, then the settings in '''Artifact/Options''' become important. In current versions of BESA, these settings are based on EEG amplitude levels. In Konstanz, we generally use the values shown on the right. Note that these values are '''irrelevant''' if we use SSP in Source Analysis.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(8).png|353x231px]]&lt;br /&gt;
&lt;br /&gt;
== Sending the data to Source Analysis ==&lt;br /&gt;
&lt;br /&gt;
When the average is generated, the correction coefficients are saved in the ''*.fsg'' file. Before you send the data to the Source Module, these coefficients must be '''activated'''.&lt;br /&gt;
&lt;br /&gt;
* If you averaged the corrected data, coefficients are already activated. This should be apparent from the red “corrected” displayed above the channel labels.&lt;br /&gt;
* If you averaged the uncorrected data, load the saved ''*.atf'' file ('''Artifact/Load…'''), and switch on correction ('''Artifact/Correct''').&lt;br /&gt;
&lt;br /&gt;
Then mark a time range and send the data to Source Analysis. At the right of the status bar, the text '''ART''' indicates that the artifact components are used in SSP.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(9).png|143x158px]]&lt;br /&gt;
&lt;br /&gt;
'''Alternatively, if you averaged the uncorrected data, load the average to Source Analysis, and then load the artifact coefficients as part of the dipole model (load or append solution, and use the dropdown list in the File Open box to select ''*.atf'' instead of ''*.bsa''). This approach has the advantage that the source waveforms of the spatial components show the contribution of eye and EKG activity to the model.'''&lt;br /&gt;
&lt;br /&gt;
This implicit application of SSP during Source Analysis is mathematically equivalent to the “optimizing” correction method (cf. Berg &amp;amp;amp; Scherg 1994): the topographies of the artifacts are implicitly incorporated into any dipole model.&lt;br /&gt;
&lt;br /&gt;
== Limitations of the correction method in BESA ==&lt;br /&gt;
&lt;br /&gt;
=== Bad channels ===&lt;br /&gt;
&lt;br /&gt;
The ''*.atf'' file contains a two-line header with a) the number of channels, and b) the channel labels. If these do not match with the current data file, artifact correction is not possible. Bad channels are marked (with an asterisk next to the label), and the corresponding coefficient is set to zero. The irritating, but logical, the consequence is that if a channel was excluded (defined as “bad”) when the coefficients were generated, it is not possible to make the channel “good” again.&lt;br /&gt;
&lt;br /&gt;
The solution is to regenerate the ''*.atf'' file, making sure the same bad channels are defined in the averaged artifact file as the to-be-corrected raw or average data file. You do not need to regenerate the artifact averages.&lt;br /&gt;
&lt;br /&gt;
EKG correction is difficult because the topographic distribution of EKG signals is close to some MEG distributions: for instance, we sometimes observe a considerable reduction in alpha amplitudes with EKG correction. For event-related averaging, an EKG correction is often unnecessary, because the EKG is not synchronized with the stimulus.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Data Import/Export]] [[Category:Preprocessing]] [[Category:Source Analysis]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data</id>
		<title>Using BESA to correct blink and EKG artifacts in MEG data</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data"/>
				<updated>2021-02-02T11:54:41Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* Pattern search for blinks and EKG */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Standard or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using BESA to correct blink and EKG artifacts in MEG data =&lt;br /&gt;
&lt;br /&gt;
Eyeblinks and EKG cause large artifact signals in the magnetometer channels. The artifact correction facilities of BESA can correct these artifacts quite well. The procedure is quite simple for blinks but more complex for EKG. The following text outlines the procedures and current limitations of BESA for artifact correction.&lt;br /&gt;
&lt;br /&gt;
The principles of the artifact correction procedure are described in ''Berg, P., Scherg, M. (1994) A multiple source approach to the correction of eye artifacts. Electroenceph. clin. Neurophysiol, 90: 229-241''.&lt;br /&gt;
&lt;br /&gt;
In summary, the following steps are required:&lt;br /&gt;
&lt;br /&gt;
* Use pattern search and average to identify the latencies of blink/EKG signals in the raw data. Pattern search works best if you have recorded a vertical EOG and EKG with the MEG data, but it will also work on selected MEG channels, using the appropriate filters.&lt;br /&gt;
* A spatial PCA is performed on the average to identify the main topographies/components of the artifact signal. For blinks, only one topography is required. For EKG, two or three topographies may be required.&lt;br /&gt;
* The topographies/components are combined into a coefficient file (''*.atf''). Using the '''Artifact''' Menu, the ''atf'' file can be loaded and correction switched on. Contrary to the warning message displayed by the ERP module, averaging can be performed using artifact corrected data.&lt;br /&gt;
* When the average is loaded into the Source Analysis module, the artifact coefficients (saved in the average file) need to be activated. They will then be incorporated into source modelling using subspace projection (SSP – see also papers by Uusitalo et al.). In this case, SSP is equivalent to the “optimized correction method” described in Berg &amp;amp;amp; Scherg (1994).&lt;br /&gt;
&lt;br /&gt;
== Pattern search for blinks and EKG ==&lt;br /&gt;
&lt;br /&gt;
=== Eyeblinks ===&lt;br /&gt;
&lt;br /&gt;
# Select filters 0.5 – 8 Hz ('''Filters/Edit Filter Settings…'''). Make sure the low cutoff filter type is '''Forward'''! (This is to ensure that no contribution from the blink topography bleeds back into the baseline time interval).&lt;br /&gt;
# View Polygraphic signals only (press the '''Pgr''' button at the top right of the BESA window), so that the vertical EOG channel is displayed&lt;br /&gt;
# Define the search block from –100 ms to +400 ms ('''Edit/Default Block Epoch…''')&lt;br /&gt;
# Select Pattern Search ('''Search/Pattern''')&lt;br /&gt;
# Select Search Query ('''Search/Query''')&lt;br /&gt;
# Select Buffer 1 for averaging ('''Tags/Pattern 1''')&lt;br /&gt;
# Identify a clear blink signal on the vertical EOG channel. Right-click at the '''onset''' of the blink, and select '''Default Block''' in the dropdown menu. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(1).png|100x75px]]&lt;br /&gt;
# Click once on the VEOG channel label, so that a rightward arrow is displayed (ignore the correlation window that opens on the right): [[File:EKG_artifacts_in_MEG_data__(2).png|134x72px]]&lt;br /&gt;
# Press the '''SAW''' button (Search/Average/Write). BESA will start scanning through the file, and it will stop at each occurrence of a blink. Press “Yes” to accept. “No” to reject, or “Stop asking” to let BESA accept everything automatically. Save the result to a file name of your choice (e.g. ''name_artifact.fsg''), labelling the segment, e.g. “blink”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
# In contrast to blink averaging we use two steps: first, filters are set to enhance the EKG for pattern search. Second, the filters are opened up, and the average is repeated.&lt;br /&gt;
# Select filters 5-20 Hz. This should generate a fairly clear signal on the EKG.&lt;br /&gt;
# Set the default block epoch so that the R-wave and the T-wave are well inside the epoch. The setting used for blinks may be OK, but you may need to extend the post-cursor interval, e.g. from 400 to 500 ms.&lt;br /&gt;
# Proceed as with blinks, but selecting Buffer 2 for averaging ('''Tags/Pattern 2'''). Mark a block around the onset of an R-wave. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(3).png|129x89px]]&lt;br /&gt;
# Save the average in the same file as the averaged blinks, labelling the segment, e.g. “EKG”.&lt;br /&gt;
# Select filters 1-30 Hz. Select '''Search/Tagged Events''', and press '''SAW'''. This repeats the average using the tags that were identified during the first step. Opening up the filters ensures that the average includes more of the EKG signal.&lt;br /&gt;
&lt;br /&gt;
=== What to do if there is no VEOG or EKG channel ===&lt;br /&gt;
&lt;br /&gt;
The procedure is similar to the above, but you need to identify a MEG channel that displays the blink or EKG waveform clearly. You may need to experiment with filter settings to make the artifact pattern clearer (the filter settings described above are not fixed rules – you may find that other settings work better for pattern search). You may find the “Create Triggers from EMG/EEG” tool helpful for detecting EKG ('''ERP/Create Triggers from EMG/EEG…'''). See the BESA help file (tutorial on creating triggers).&lt;br /&gt;
&lt;br /&gt;
== Spatial PCA and the *.atf file ==&lt;br /&gt;
&lt;br /&gt;
Open the file in which you saved the averages (e.g. ''name_artifact.fsg''). Make sure that prestimulus baseline correction is switched on ('''Filters/Use Prestimulus Baseline''').&lt;br /&gt;
&lt;br /&gt;
=== Blinks ===&lt;br /&gt;
&lt;br /&gt;
# Mark the whole blink epoch: Right-click onto the epoch, and select '''Whole Segment'''.&lt;br /&gt;
# Select '''Artifact/Assign/Blink'''. The spatial PCA is computed, and the first spatial component is assigned to describe the blink. You may check if the correction works by selecting '''Artifact/Correct'''.&lt;br /&gt;
# The coefficients are saved automatically to a file with the same basename as the average, and the extension ''“.atf''”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
EKG coefficients are corrected analogously to blinks. A difference is that the topographic distribution of the EKG over the MEG sensors is more complex than that of blinks. It changes over time. The reasons for this are unclear, and may be due to movement of the heart (and its equivalent dipoles) over time, but also to ballistic effects: movement of the head due to blood flow.&lt;br /&gt;
&lt;br /&gt;
Since topographic distribution changes over time, more than one component is required for correction. We choose the number of components in the Artifact Select Dialog Box empirically: As a rule of thumb, if a component explains more than 5-10% of the variance of the averaged EKG signal, the component is included. Note that the number of components you select can also be changed when the coefficients are applied to the raw data.&lt;br /&gt;
&lt;br /&gt;
== Correcting the raw data ==&lt;br /&gt;
&lt;br /&gt;
* Switch back to the raw data file, and load the ''*.atf'' file you have created ('''Artifact/Load…''').&lt;br /&gt;
* Optionally, check that the artifact correction channels are visible (Artifact/View)&lt;br /&gt;
* Switch on artifact correction (Artifact/Correct).&lt;br /&gt;
* The figure on the next page shows the result of correction of channels A75-A148 on a three-second interval containing both EKG and eye activity. The blue label “1” marks the onset of a blink found during pattern search. The red “2” shows the onset of R-waves found during pattern search.&lt;br /&gt;
* Note that correction is quite good, but it is not perfect. In particular, there is some residual eye activity, e.g. around channels A91, A113, A131.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! '''uncorrected'''&lt;br /&gt;
! '''corrected'''&lt;br /&gt;
|-&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(4).png|57x57px]][[File:EKG_artifacts_in_MEG_data__(5).png|272x802px]]&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(6).png|273x801px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Averaging the raw data ==&lt;br /&gt;
&lt;br /&gt;
You can leave correction on during data averaging. When you press the Average button, a warning dialog will appear:&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(7).png|539x124px]]&lt;br /&gt;
&lt;br /&gt;
You may select either option. Because of the recent installation of subspace projection (SSP) in the Source Module, the “distorted topographies” in the warning are no longer an issue for source analysis, provided SSP is switched on when the data are sent to the Source Module. The decision has consequences a) if you intend to analyze data waveform amplitudes and/or latencies, and b) if you intend to export the averages for analysis with other software.&lt;br /&gt;
&lt;br /&gt;
==== Option “Yes” – turn off artifact correction ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will include EKG and eye artifacts, but these artifacts will not cause epochs to be rejected. The same number of epochs will be included in the average whether or not “Yes” or “No” is chosen.&lt;br /&gt;
&lt;br /&gt;
You may load the correction coefficients (''*.atf'') for the average, and switch on artifact correction.&lt;br /&gt;
&lt;br /&gt;
==== Option “No” – leave artifact correction on ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will be corrected. Each epoch is corrected before being included in the average.&lt;br /&gt;
&lt;br /&gt;
==== Artifact options: which correction model? ====&lt;br /&gt;
&lt;br /&gt;
The result of the correction on the raw data or the averaged data can be slightly different. The effects of correction will also vary, depending on the settings in '''Artifact/Options'''. These differences can be considered as consequences of variations in the “surrogate” or “adaptive” model of brain activity concurrent with the artifact activity (cf. Berg &amp;amp;amp; Scherg 1994). These differences lead to changes in the estimate of the amounts of artifact activity to be removed by correction. If you intend to use the data waveforms outside BESA, and if you don’t use SSP with the artifact coefficients, then the settings in '''Artifact/Options''' become important. In current versions of BESA, these settings are based on EEG amplitude levels. In Konstanz, we generally use the values shown on the right. Note that these values are '''irrelevant''' if we use SSP in Source Analysis.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(8).png|353x231px]]&lt;br /&gt;
&lt;br /&gt;
== Sending the data to Source Analysis ==&lt;br /&gt;
&lt;br /&gt;
When the average is generated, the correction coefficients are saved in the ''*.fsg'' file. Before you send the data to the Source Module, these coefficients must be '''activated'''.&lt;br /&gt;
&lt;br /&gt;
* If you averaged the corrected data, coefficients are already activated. This should be apparent from the red “corrected” displayed above the channel labels.&lt;br /&gt;
* If you averaged the uncorrected data, load the saved ''*.atf'' file ('''Artifact/Load…'''), and switch on correction ('''Artifact/Correct''').&lt;br /&gt;
&lt;br /&gt;
Then mark a time range and send the data to Source Analysis. At the right of the status bar, the text '''ART''' indicates that the artifact components are used in SSP.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(9).png|143x158px]]&lt;br /&gt;
&lt;br /&gt;
'''Alternatively, if you averaged the uncorrected data, load the average to Source Analysis, and then load the artifact coefficients as part of the dipole model (load or append solution, and use the dropdown list in the File Open box to select ''*.atf'' instead of ''*.bsa''). This approach has the advantage that the source waveforms of the spatial components show the contribution of eye and EKG activity to the model.'''&lt;br /&gt;
&lt;br /&gt;
This implicit application of SSP during Source Analysis is mathematically equivalent to the “optimizing” correction method (cf. Berg &amp;amp;amp; Scherg 1994): the topographies of the artifacts are implicitly incorporated into any dipole model.&lt;br /&gt;
&lt;br /&gt;
== Limitations of the correction method in BESA ==&lt;br /&gt;
&lt;br /&gt;
=== Bad channels ===&lt;br /&gt;
&lt;br /&gt;
The ''*.atf'' file contains a two-line header with a) the number of channels, and b) the channel labels. If these do not match with the current data file, artifact correction is not possible. Bad channels are marked (with an asterisk next to the label), and the corresponding coefficient is set to zero. The irritating, but logical, the consequence is that if a channel was excluded (defined as “bad”) when the coefficients were generated, it is not possible to make the channel “good” again.&lt;br /&gt;
&lt;br /&gt;
The solution is to regenerate the ''*.atf'' file, making sure the same bad channels are defined in the averaged artifact file as the to-be-corrected raw or average data file. You do not need to regenerate the artifact averages.&lt;br /&gt;
&lt;br /&gt;
EKG correction is difficult because the topographic distribution of EKG signals is close to some MEG distributions: for instance, we sometimes observe a considerable reduction in alpha amplitudes with EKG correction. For event-related averaging, an EKG correction is often unnecessary, because the EKG is not synchronized with the stimulus.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Data Import/Export]] [[Category:Preprocessing]] [[Category:Source Analysis]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Main_Page"/>
				<updated>2021-02-02T11:47:05Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* File Formats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;font-size: 200%;&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Welcome to the BESA Wiki!&amp;lt;/strong&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This wiki is designed to help users with typical questions around using BESA to achieve their goals.&lt;br /&gt;
&lt;br /&gt;
Topics are available for the following categories:&lt;br /&gt;
&lt;br /&gt;
== Manual ==&lt;br /&gt;
&lt;br /&gt;
[[BESA Research Manual]]&lt;br /&gt;
&lt;br /&gt;
== Videos ==&lt;br /&gt;
&lt;br /&gt;
[[Video tutorials]]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
:[[Licensing]]&lt;br /&gt;
&lt;br /&gt;
:[[License session not freed|License session not freed (BESA MRI 64 bit version)]] &lt;br /&gt;
&lt;br /&gt;
=== File Formats ===&lt;br /&gt;
&lt;br /&gt;
:[[ASCII File Format]]&lt;br /&gt;
&lt;br /&gt;
:[[Channel Definition File Formats]]&lt;br /&gt;
&lt;br /&gt;
:[[Event File Format]]&lt;br /&gt;
&lt;br /&gt;
:[[MEG Sensor Coordinate Files]]&lt;br /&gt;
&lt;br /&gt;
:[[Supported Data Formats]]&lt;br /&gt;
&lt;br /&gt;
:[[Paradigm File Format in BESA]]&lt;br /&gt;
&lt;br /&gt;
:[[Importing Electrode Locations in Combined EEG/MEG Measurements with the Neuromag System]]&lt;br /&gt;
&lt;br /&gt;
:[[BESA files extensions]]&lt;br /&gt;
&lt;br /&gt;
:[[Talairach Transformation File]]&lt;br /&gt;
&lt;br /&gt;
:[[Reading BioSemi data with BESA]]&lt;br /&gt;
&lt;br /&gt;
:[[Using Net Station Data with BESA]]&lt;br /&gt;
&lt;br /&gt;
=== Data Review and Analysis ===&lt;br /&gt;
&lt;br /&gt;
:[[Importing Digitized Coordinates]]&lt;br /&gt;
&lt;br /&gt;
:[[Verify Electrode Coordinates]]&lt;br /&gt;
&lt;br /&gt;
:[[Export Single Trial Data]]&lt;br /&gt;
&lt;br /&gt;
:[[How to Average EEG channels]]&lt;br /&gt;
&lt;br /&gt;
:[[Averaging Across EEG Datasets from Different Recording Systems]]&lt;br /&gt;
&lt;br /&gt;
:[[Time Frequency Resolution In BESA]]&lt;br /&gt;
&lt;br /&gt;
:[[Change Waveform Colours]]&lt;br /&gt;
&lt;br /&gt;
:[[Best Strategy to Define a Multiple Source Model]]&lt;br /&gt;
&lt;br /&gt;
:[[Export Dipole Moments of Fitted Sources]]&lt;br /&gt;
&lt;br /&gt;
:[[Recommended Electrode Configurations]]&lt;br /&gt;
&lt;br /&gt;
:[[Exporting Artifact-Corrected Data]]&lt;br /&gt;
&lt;br /&gt;
:[[Create Triggers for Artifact-Rejected Epochs]]&lt;br /&gt;
&lt;br /&gt;
:[[Inserting Triggers Relative to Existing Events]]&lt;br /&gt;
&lt;br /&gt;
:[[Change or Exclude Erroneous Head Surface Point Locations]]&lt;br /&gt;
&lt;br /&gt;
:[[Exporting Top Viewer Waveforms into other Graphics Software for Further Processing]]&lt;br /&gt;
&lt;br /&gt;
:[[Seed dipole solutions from cortical images]]&lt;br /&gt;
&lt;br /&gt;
:[[Pipeline for simultaneous EEG-fMRI recording]]&lt;br /&gt;
&lt;br /&gt;
:[[The source space in individual FEM head models]]&lt;br /&gt;
&lt;br /&gt;
:[[Export each gradiometer and magnetometer data separately]]&lt;br /&gt;
&lt;br /&gt;
:[[Peak Finder explained]]&lt;br /&gt;
&lt;br /&gt;
:[[Using BESA to correct blink and EKG artifacts in MEG data]]&lt;br /&gt;
&lt;br /&gt;
=== MATLAB interface ===&lt;br /&gt;
&lt;br /&gt;
:[[How Do I Configure the Matlab Interface?]]&lt;br /&gt;
&lt;br /&gt;
:[[Updating the Matlab Interface after Matlab Upgrade]]&lt;br /&gt;
&lt;br /&gt;
:[[Exporting Data from Matlab to BESA Statistics]]&lt;br /&gt;
&lt;br /&gt;
:[[Visualization with BESA Plot in FieldTrip]]&lt;br /&gt;
&lt;br /&gt;
=== BESA MRI===&lt;br /&gt;
&lt;br /&gt;
:[[Marking AC-PC Points in BESA MRI]]&lt;br /&gt;
&lt;br /&gt;
=== BESA Statistics ===&lt;br /&gt;
&lt;br /&gt;
:[[Cluster Alpha vs. Neighbor Distance]]&lt;br /&gt;
&lt;br /&gt;
:[[How to Prepare Data for BESA Statistics]]&lt;br /&gt;
&lt;br /&gt;
:[[Importing BESA Statistics Results into Excel]]&lt;br /&gt;
&lt;br /&gt;
:[[Exporting Data from Matlab to BESA Statistics]]&lt;br /&gt;
&lt;br /&gt;
=== BESA Connectivity ===&lt;br /&gt;
&lt;br /&gt;
:[[How to Prepare Data for BESA Connectivity]]&lt;br /&gt;
&lt;br /&gt;
:[[Export Connectivity Results]]&lt;br /&gt;
&lt;br /&gt;
:[[How to Convert BESA Connectivity results for BESA Statistics]]&lt;br /&gt;
&lt;br /&gt;
=== Operating systems ===&lt;br /&gt;
&lt;br /&gt;
:[[Running BESA Research on the Mac]]&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
:[[MF Error 211| The internal error MF_211 (BESA MRI, BESA Statistics and BESA Connectivity)]]&lt;br /&gt;
&lt;br /&gt;
:[[3D Graphics Display Issue Handling]]&lt;br /&gt;
&lt;br /&gt;
:[[Batch Error Handling]]&lt;br /&gt;
&lt;br /&gt;
:[[Error message: Failed to load library|Error message: Failed to load library during software installation]]&lt;br /&gt;
&lt;br /&gt;
:[[License session not freed|License session not freed in BESA MRI 64 bit version]]&lt;br /&gt;
&lt;br /&gt;
:[[Install And Update File Format Readers]]&lt;br /&gt;
&lt;br /&gt;
:[[Wrong characters in BESA software]]&lt;br /&gt;
&lt;br /&gt;
:[[Blank white screen when capturing the 3D window of the source analysis window]]&lt;br /&gt;
&lt;br /&gt;
:[[Error opening program or opening the file dialog box]]&lt;br /&gt;
&lt;br /&gt;
== BESA Recipes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2; -moz-column-count:2; -webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Control of BESA Research by external programs]]&lt;br /&gt;
* [[Correcting Volume Conductor Segmentations]]&lt;br /&gt;
* [[Exporting Data from Matlab to BESA Statistics]]&lt;br /&gt;
* [[Integration of Custom Template Head-Models]]&lt;br /&gt;
* [[Random Averaging]]&lt;br /&gt;
* [[Statistical Analysis for More than Two Levels]]&lt;br /&gt;
* [[Visualization with BESA Plot in FieldTrip]]&lt;br /&gt;
* [[Pipeline for simultaneous EEG-fMRI recording]]&lt;br /&gt;
* [[How to deal with TMS artifact in BESA Research]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Did you know...? ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2; -moz-column-count:2; -webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Moving Dipole Fit]]&lt;br /&gt;
* [[BESA Anonymizer]]&lt;br /&gt;
* [[Batch Processing]]&lt;br /&gt;
* [[Analyzing Electrocorticography Data]]&lt;br /&gt;
* [[Advanced Top Viewer Features]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Coming soon ==&lt;br /&gt;
&lt;br /&gt;
* a collection of useful batches&lt;br /&gt;
* and further content we will be publishing on this wiki&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Contributions to the Wiki from the community are very welcome! Please create an account with a valid email to edit the BESA Wiki's content.&lt;br /&gt;
&lt;br /&gt;
Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Using_Net_Station_Data_with_BESA</id>
		<title>Using Net Station Data with BESA</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Using_Net_Station_Data_with_BESA"/>
				<updated>2021-02-02T11:46:24Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Using Net Station Data with BESA =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
When sharing Net Station data with BESA, it is best to either share:&lt;br /&gt;
&lt;br /&gt;
* Data that hasn’t been processed in any way, except segmentation markup, discussed below (ie don’t filter, don’t convert to microvolts [in the future, after a known issue in Net Station is resolved it will be possible to convert to microvolts]), or&lt;br /&gt;
* ERP data, in other words, data that has been processed in Net Station all the way through averaging.&lt;br /&gt;
&lt;br /&gt;
In either case, the recommended file format is Epoch Marked Simple Binary File. Also, known as Epoch Marked Raw. Export to this format is only available in Net Station 3.0, through the File Export tool of the Waveform Tools. If you need to share Net Station data with BESA, and you don’t have access to this tool, please contact EGI Support ([mailto:support@egi.com) support@egi.com)].&lt;br /&gt;
&lt;br /&gt;
The details vary, depending on whether you are exporting unprocessed data or ERP data. Each of these cases is discussed below:&lt;br /&gt;
&lt;br /&gt;
== Exporting Unprocessed Data ==&lt;br /&gt;
&lt;br /&gt;
=== Segmentation Markup ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are familiar with Net Station Segmentation, and the structure of a simple standard/target experiment.&lt;br /&gt;
&lt;br /&gt;
Net Station events contain key lists, in other words, mini databases. Using a simple standard/target experiment as an example, in Net Station all stimuli events might be named “stim.” The distinction between standards and targets can’t be determined from the name of the event. It can only be determined from the key list in the events. In most programs, including BESA, events only have names. They don’t have key lists.&lt;br /&gt;
&lt;br /&gt;
To make the jump from key-list events to non-keylist events, you must use Net Station’s segmentation markup. Segmentation markup adds events to the recording that BESA can use. To use segmentation markup, create a segmentation specification, and check the “Mark Up File” checkbox in the segmentation specification editor. When you run segmentation using this specification, instead of segmenting the file, new events will be added for BESA.&lt;br /&gt;
&lt;br /&gt;
For example, if all your standard and target stimuli are named “stim”, you would create a segmentation specification just as you would for segmenting this file into standard and target categories. Then, if you check the “Mark Up File” checkbox, the specification will cause new events to be added to the file instead of segmentation. Then, you can add events called “stnd” for standard, and “targ” for target.&lt;br /&gt;
&lt;br /&gt;
Note: Although Net Station allows you to add markup events with spaces in the names, it might cause unpredictable results in BESA. Also, Net Station generates the event names automatically, but you can modify them. Sometimes the automatically generated ones contain spaces. Simply edit them, for example, replace the spaces with underscore characters.&lt;br /&gt;
&lt;br /&gt;
The objective is to be able to do segmentation in BESA. So, before exporting to BESA, use segmentation markup to add all the events you might want to use in BESA. Although a simple standard/target experiment was used in this example, you can combine the full power of Net Station’s segmentation with the segmentation markup feature.&lt;br /&gt;
&lt;br /&gt;
=== Export ===&lt;br /&gt;
&lt;br /&gt;
As mentioned above, you need to export to the Epoch Marked Simple Binary File format using the File Export tool. The following explains the options to use:&lt;br /&gt;
&lt;br /&gt;
Since this data hasn’t been re-referenced, do not export the reference channel. In other words, leave the “Export Reference Channel” checkbox unchecked.&lt;br /&gt;
&lt;br /&gt;
You have the option of using integer or floating-point precision. Each of these options is discussed below.&lt;br /&gt;
&lt;br /&gt;
The advantage of using integer precision is that export is faster, and results in a file that is about half the size of floating-point. The disadvantage is that the individual gains and zeros aren’t applied to the data. If your amplifier is in spec, the loss should be negligible. If you choose this option, leave the “Calibrate Data” checkbox unchecked.&lt;br /&gt;
&lt;br /&gt;
The advantage of using floating-point precision is that it is much more precise. The disadvantage is that export is slower, and results in a file that is about twice the size of an integer. If you choose this option, make sure that you do check the “Calibrate Data” checkbox.&lt;br /&gt;
&lt;br /&gt;
In either case, set the name of the output file to append the extension “.raw”.&lt;br /&gt;
&lt;br /&gt;
=== Opening in BESA ===&lt;br /&gt;
&lt;br /&gt;
After you have generated the .raw file, move it to the BESA PC. You should now be able to read this file with BESA. To do so, in the File Open Dialog Box, set the “Files of type” dropdown list to “EGI Formats(*.raw…”.&lt;br /&gt;
&lt;br /&gt;
If you do this, BESA will read all the events in the file, and assign trigger numbers to them (except the following, which are meaningless to BESA: CELL, SESS, bgin and TRSP).&lt;br /&gt;
&lt;br /&gt;
Optionally, you can control which events are read by BESA by creating a .trig file. A .trig file is a tab-delimited file that contains one line for each event type that you want BESA to read. Each line consists of the name of the event, followed by a tab character, followed by a number between 1 and &amp;amp;lt;255? 256? 65535? 65536?&amp;amp;gt;. The following is an example of a .trig file:&lt;br /&gt;
&lt;br /&gt;
stnd 1&lt;br /&gt;
&lt;br /&gt;
targ 2&lt;br /&gt;
&lt;br /&gt;
resp 128&lt;br /&gt;
&lt;br /&gt;
You might want to use a .trig file if:&lt;br /&gt;
&lt;br /&gt;
* your data has a large number of events, and you don’t need most of them in BESA, or,&lt;br /&gt;
* you want to include events with any of these names: CELL, SESS, bgin and TRSP.&lt;br /&gt;
&lt;br /&gt;
To use a .trig file, just make sure that the file is in the same directory as your data file when you open the data file. In addition, the .trig file must be named either “default.trig”, or &amp;amp;lt;your data file name&amp;amp;gt;.trig (eg “subject1.trig”).&lt;br /&gt;
&lt;br /&gt;
=== Loading Sensor Coordinates ===&lt;br /&gt;
&lt;br /&gt;
After you have opened the file, you must load the sensor coordinate files (File-&amp;amp;gt;”Head Surface Points and Sensors”-&amp;amp;gt;”Load Coordinate Files”. If want to use average sensor position files (as opposed to files individually digitized for your subject), use the files in “C:\Besa\Examples\Xtras\EEG Binary Formats\EGI” directory.&lt;br /&gt;
&lt;br /&gt;
If you have 256 channel data, use GSN256andRef.ela, and GSN257.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 128 channel data, use GSN128andRef.ela, and GSN129.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v1, use GSN64andRef.ela, and GSN65v1_0.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v2, use GSN64andRef.ela, and GSN65v2_0.sfp.&lt;br /&gt;
&lt;br /&gt;
You are now ready to do your ERP derivation in BESA.&lt;br /&gt;
&lt;br /&gt;
== Exporting Averaged ERP Data ==&lt;br /&gt;
&lt;br /&gt;
=== Export ===&lt;br /&gt;
&lt;br /&gt;
If you have derived your ERP in Net Station, and wish to export it to BESA for source localization, once again, use the File Export tool, exporting in the Epoch Marked Simple Binary File format. The following explains the options to use:&lt;br /&gt;
&lt;br /&gt;
(This explanation assumes that the data has been re-referenced during the ERP derivation process.)&lt;br /&gt;
&lt;br /&gt;
Since this data has been re-referenced, you should export the reference channel. In other words, check the “Export Reference Channel” checkbox.&lt;br /&gt;
&lt;br /&gt;
For averaged data, you need to export using floating-point precision. Since the data has been calibrated during the ERP derivation process, it doesn’t matter what you do with the “Calibrate Data” checkbox. Set the name of the output file to append the extension “.raw”.&lt;br /&gt;
&lt;br /&gt;
When exporting averaged ERP data (or any Net Station data that has been categorized, for example, segmented data), Net Station generates an additional file: &amp;amp;lt; your file name&amp;amp;gt;.epoc. This file contains the names of the conditions for each epoch in the data.&lt;br /&gt;
&lt;br /&gt;
=== Opening in BESA ===&lt;br /&gt;
&lt;br /&gt;
After you have generated the .raw file, move it, and the .epoc file, to the BESA PC, keeping both files in the same directory. You should now be able to read this file with BESA. To do so, in the File Open Dialog Box, set the “Files of type” dropdown list to “EGI Formats(*.raw…”.&lt;br /&gt;
&lt;br /&gt;
=== Loading Sensor Coordinates ===&lt;br /&gt;
&lt;br /&gt;
After you have opened the file, you must load the sensor coordinate files (File-&amp;amp;gt;”Head Surface Points and Sensors”-&amp;amp;gt;”Load Coordinate Files”. If want to use average sensor position files (as opposed to files individually digitized for your subject), use the files in “C:\Besa\Examples\Xtras\EEG Binary Formats\EGI” directory.&lt;br /&gt;
&lt;br /&gt;
If you have 256 channel data, use GSN257.ela, and GSN257.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 128 channel data, use GSN129.ela, and GSN129.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v1, use GSN65.ela, and GSN65v1_0.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v2, use GSN65.ela, and GSN65v2_0.sfp.&lt;br /&gt;
&lt;br /&gt;
You are now ready to do source analysis in BESA.&lt;br /&gt;
&lt;br /&gt;
[[Category:Setup]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Using_Net_Station_Data_with_BESA</id>
		<title>Using Net Station Data with BESA</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Using_Net_Station_Data_with_BESA"/>
				<updated>2021-02-02T11:45:07Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* Export */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Using Net Station Data with BESA =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
When sharing Net Station data with BESA, it is best to either share:&lt;br /&gt;
&lt;br /&gt;
* Data that hasn’t been processed in any way, except segmentation markup, discussed below (ie don’t filter, don’t convert to microvolts [in the future, after a known issue in Net Station is resolved it will be possible to convert to microvolts]), or&lt;br /&gt;
* ERP data, in other words data that has been processed in Net Station all the way through averaging.&lt;br /&gt;
&lt;br /&gt;
In either case, the recommended file format is Epoch Marked Simple Binary File. Also, known as Epoch Marked Raw. Export to this format is only available in Net Station 3.0, through the File Export tool of the Waveform Tools. If you need to share Net Station data with BESA, and you don’t have access to this tool, please contact EGI Support ([mailto:support@egi.com) support@egi.com)].&lt;br /&gt;
&lt;br /&gt;
The details vary, depending on whether you are exporting unprocessed data, or ERP data. Each of these cases is discussed below:&lt;br /&gt;
&lt;br /&gt;
== Exporting Unprocessed Data ==&lt;br /&gt;
&lt;br /&gt;
=== Segmentation Markup ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are familiar with Net Station Segmentation, and the structure of a simple standard/target experiment.&lt;br /&gt;
&lt;br /&gt;
Net Station events contain key lists, in other words, mini databases. Using a simple standard/target experiment as an example, in Net Station all stimulii events might be named “stim.” The distinction between standards and targets can’t be determined from the name of the event. It can only be determined from the key list in the events. In most programs, including BESA, events only have names. They don’t have key lists.&lt;br /&gt;
&lt;br /&gt;
To make the jump from key-list events to non-keylist events, you must use Net Station’s segmentation markup. Segmentation markup adds events to the recording that BESA can use. To use segmentation markup, create a segmentation specification, and check the “Mark Up File” checkbox in the segmentation specification editor. When you run segmentation using this specification, instead of segmenting the file, new events will be added for BESA.&lt;br /&gt;
&lt;br /&gt;
For example, if all your standard and target stimulii are named “stim”, you would create a segmentation specification just as you would for segmenting this file into standard and target categories. Then, if you check the “Mark Up File” checkbox, the specification will cause new events to be added to the file instead of segmentation. Then, you can add events called “stnd” for standard, and “targ” for target.&lt;br /&gt;
&lt;br /&gt;
Note: Although Net Station allows you to add markup events with spaces in the names, it might cause unpredictable results in BESA. Also, Net Station generates the event names automatically, but you can modify them. Sometimes the automatically generated ones contain spaces. Simply edit them, for example, replace thespaces with underscore characters.&lt;br /&gt;
&lt;br /&gt;
The objective is to be able to do segmentation in BESA. So, before exporting to BESA, use segmentation markup to add all the events you might want to use in BESA. Although a simple standard/target experiment was used in this example, you can combine the full power of Net Station’s segmentation with the segmentation markup feature.&lt;br /&gt;
&lt;br /&gt;
=== Export ===&lt;br /&gt;
&lt;br /&gt;
As mentioned above, you need to export to the Epoch Marked Simple Binary File format using the File Export tool. The following explains the options to use:&lt;br /&gt;
&lt;br /&gt;
Since this data hasn’t been rereferenced, do not export the reference channel. In other words, leave the “Export Reference Channel” checkbox unchecked.&lt;br /&gt;
&lt;br /&gt;
You have the option of using integer or floating point precision. Each of these options is discussed below.&lt;br /&gt;
&lt;br /&gt;
The advantage of using integer precision is that export is faster, and results in a file that is about half the size of floating point. The disadvantage is that the individual gains and zeros aren’t applied to the data. If your amplifier is in spec, the loss should be negligible. If you choose this option, leave the “Calibrate Data” checkbox unchecked.&lt;br /&gt;
&lt;br /&gt;
The advantage of using floating point precision is that it is much more precise. The disadvantage is that export is slower, and results in a file that is about twice the size of integer. If you choose this option, make sure that you do check the “Calibrate Data” checkbox.&lt;br /&gt;
&lt;br /&gt;
In either case, set the name of the output file to append the extention “.raw”.&lt;br /&gt;
&lt;br /&gt;
=== Opening in BESA ===&lt;br /&gt;
&lt;br /&gt;
After you have generated the .raw file, move it to the BESA PC. You should now be able to read this file with BESA. To do so, in the File Open Dialog Box, set the “Files of type” dropdown list to “EGI Formats(*.raw…”.&lt;br /&gt;
&lt;br /&gt;
If you do this, BESA will read all the events in the file, and assign trigger numbers to them (except the following, which are meaningless to BESA: CELL, SESS, bgin and TRSP).&lt;br /&gt;
&lt;br /&gt;
Optionally, you can control which events are read by BESA by creating a .trig file. A .trig file is a tab delimited file that contains one line for each event type that you want BESA to read. Each line consists of the name of the event, followed by a tab character, followed by a number between 1 and &amp;amp;lt;255? 256? 65535? 65536?&amp;amp;gt;. The following is an example of a .trig file:&lt;br /&gt;
&lt;br /&gt;
stnd 1&lt;br /&gt;
&lt;br /&gt;
targ 2&lt;br /&gt;
&lt;br /&gt;
resp 128&lt;br /&gt;
&lt;br /&gt;
You might want to use a .trig file if:&lt;br /&gt;
&lt;br /&gt;
* your data has a large number of events, and you don’t need most of them in BESA, or,&lt;br /&gt;
* you want to include events with any of these names: CELL, SESS, bgin and TRSP.&lt;br /&gt;
&lt;br /&gt;
To use a .trig file, just make sure that the file is in the same directory as your data file when you open the data file. In addition, the .trig file must be named either “detault.trig”, or &amp;amp;lt;your data file name&amp;amp;gt;.trig (eg “subject1.trig”).&lt;br /&gt;
&lt;br /&gt;
=== Loading Sensor Coordinates ===&lt;br /&gt;
&lt;br /&gt;
After you have opened the file, you must load the sensor coordinate files (File-&amp;amp;gt;”Head Surface Points and Sensors”-&amp;amp;gt;”Load Coordinate Files”. If want to use average sensor position files (as opposed to files individually digitized for your subject), use the files in “C:\Besa\Examples\Xtras\EEG Binary Formats\EGI” directory.&lt;br /&gt;
&lt;br /&gt;
If you have 256 channel data, use GSN256andRef.ela, and GSN257.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 128 channel data, use GSN128andRef.ela, and GSN129.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v1, use GSN64andRef.ela, and GSN65v1_0.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v2, use GSN64andRef.ela, and GSN65v2_0.sfp.&lt;br /&gt;
&lt;br /&gt;
You are now ready to do your ERP derivation in BESA.&lt;br /&gt;
&lt;br /&gt;
== Exporting Averaged ERP Data ==&lt;br /&gt;
&lt;br /&gt;
=== Export ===&lt;br /&gt;
&lt;br /&gt;
If you have derived your ERP in Net Station, and wish to export it to BESA for source localization, once again, use the File Export tool, exporting in the Epoch Marked Simple Binary File format. The following explains the options to use:&lt;br /&gt;
&lt;br /&gt;
(This explanation assumes that the data has been re-referenced during the ERP derivation process.)&lt;br /&gt;
&lt;br /&gt;
Since this data has been re-referenced, you should export the reference channel. In other words, check the “Export Reference Channel” checkbox.&lt;br /&gt;
&lt;br /&gt;
For averaged data, you need to export using floating-point precision. Since the data has been calibrated during the ERP derivation process, it doesn’t matter what you do with the “Calibrate Data” checkbox. Set the name of the output file to append the extension “.raw”.&lt;br /&gt;
&lt;br /&gt;
When exporting averaged ERP data (or any Net Station data that has been categorized, for example, segmented data), Net Station generates an additional file: &amp;amp;lt; your file name&amp;amp;gt;.epoc. This file contains the names of the conditions for each epoch in the data.&lt;br /&gt;
&lt;br /&gt;
=== Opening in BESA ===&lt;br /&gt;
&lt;br /&gt;
After you have generated the .raw file, move it, and the .epoc file, to the BESA PC, keeping both files in the same directory. You should now be able to read this file with BESA. To do so, in the File Open Dialog Box, set the “Files of type” dropdown list to “EGI Formats(*.raw…”.&lt;br /&gt;
&lt;br /&gt;
=== Loading Sensor Coordinates ===&lt;br /&gt;
&lt;br /&gt;
After you have opened the file, you must load the sensor coordinate files (File-&amp;amp;gt;”Head Surface Points and Sensors”-&amp;amp;gt;”Load Coordinate Files”. If want to use average sensor position files (as opposed to files individually digitized for your subject), use the files in “C:\Besa\Examples\Xtras\EEG Binary Formats\EGI” directory.&lt;br /&gt;
&lt;br /&gt;
If you have 256 channel data, use GSN257.ela, and GSN257.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 128 channel data, use GSN129.ela, and GSN129.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v1, use GSN65.ela, and GSN65v1_0.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v2, use GSN65.ela, and GSN65v2_0.sfp.&lt;br /&gt;
&lt;br /&gt;
You are now ready to do source analysis in BESA.&lt;br /&gt;
&lt;br /&gt;
[[Category:Setup]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Using_Net_Station_Data_with_BESA</id>
		<title>Using Net Station Data with BESA</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Using_Net_Station_Data_with_BESA"/>
				<updated>2021-02-02T11:44:09Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: Created page with &amp;quot;{{BESAInfobox |title = Module information |module = BESA Research Basic or higher |version = 6.0 or higher }}  = Using Net Station Data with BESA =  == Introduction ==  When s...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic or higher&lt;br /&gt;
|version = 6.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Using Net Station Data with BESA =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
When sharing Net Station data with BESA, it is best to either share:&lt;br /&gt;
&lt;br /&gt;
* Data that hasn’t been processed in any way, except segmentation markup, discussed below (ie don’t filter, don’t convert to microvolts [in the future, after a known issue in Net Station is resolved it will be possible to convert to microvolts]), or&lt;br /&gt;
* ERP data, in other words data that has been processed in Net Station all the way through averaging.&lt;br /&gt;
&lt;br /&gt;
In either case, the recommended file format is Epoch Marked Simple Binary File. Also, known as Epoch Marked Raw. Export to this format is only available in Net Station 3.0, through the File Export tool of the Waveform Tools. If you need to share Net Station data with BESA, and you don’t have access to this tool, please contact EGI Support ([mailto:support@egi.com) support@egi.com)].&lt;br /&gt;
&lt;br /&gt;
The details vary, depending on whether you are exporting unprocessed data, or ERP data. Each of these cases is discussed below:&lt;br /&gt;
&lt;br /&gt;
== Exporting Unprocessed Data ==&lt;br /&gt;
&lt;br /&gt;
=== Segmentation Markup ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are familiar with Net Station Segmentation, and the structure of a simple standard/target experiment.&lt;br /&gt;
&lt;br /&gt;
Net Station events contain key lists, in other words, mini databases. Using a simple standard/target experiment as an example, in Net Station all stimulii events might be named “stim.” The distinction between standards and targets can’t be determined from the name of the event. It can only be determined from the key list in the events. In most programs, including BESA, events only have names. They don’t have key lists.&lt;br /&gt;
&lt;br /&gt;
To make the jump from key-list events to non-keylist events, you must use Net Station’s segmentation markup. Segmentation markup adds events to the recording that BESA can use. To use segmentation markup, create a segmentation specification, and check the “Mark Up File” checkbox in the segmentation specification editor. When you run segmentation using this specification, instead of segmenting the file, new events will be added for BESA.&lt;br /&gt;
&lt;br /&gt;
For example, if all your standard and target stimulii are named “stim”, you would create a segmentation specification just as you would for segmenting this file into standard and target categories. Then, if you check the “Mark Up File” checkbox, the specification will cause new events to be added to the file instead of segmentation. Then, you can add events called “stnd” for standard, and “targ” for target.&lt;br /&gt;
&lt;br /&gt;
Note: Although Net Station allows you to add markup events with spaces in the names, it might cause unpredictable results in BESA. Also, Net Station generates the event names automatically, but you can modify them. Sometimes the automatically generated ones contain spaces. Simply edit them, for example, replace thespaces with underscore characters.&lt;br /&gt;
&lt;br /&gt;
The objective is to be able to do segmentation in BESA. So, before exporting to BESA, use segmentation markup to add all the events you might want to use in BESA. Although a simple standard/target experiment was used in this example, you can combine the full power of Net Station’s segmentation with the segmentation markup feature.&lt;br /&gt;
&lt;br /&gt;
=== Export ===&lt;br /&gt;
&lt;br /&gt;
As mentioned above, you need to export to the Epoch Marked Simple Binary File format using the File Export tool. The following explains the options to use:&lt;br /&gt;
&lt;br /&gt;
Since this data hasn’t been rereferenced, do not export the reference channel. In other words, leave the “Export Reference Channel” checkbox unchecked.&lt;br /&gt;
&lt;br /&gt;
You have the option of using integer or floating point precision. Each of these options is discussed below.&lt;br /&gt;
&lt;br /&gt;
The advantage of using integer precision is that export is faster, and results in a file that is about half the size of floating point. The disadvantage is that the individual gains and zeros aren’t applied to the data. If your amplifier is in spec, the loss should be negligible. If you choose this option, leave the “Calibrate Data” checkbox unchecked.&lt;br /&gt;
&lt;br /&gt;
The advantage of using floating point precision is that it is much more precise. The disadvantage is that export is slower, and results in a file that is about twice the size of integer. If you choose this option, make sure that you do check the “Calibrate Data” checkbox.&lt;br /&gt;
&lt;br /&gt;
In either case, set the name of the output file to append the extention “.raw”.&lt;br /&gt;
&lt;br /&gt;
=== Opening in BESA ===&lt;br /&gt;
&lt;br /&gt;
After you have generated the .raw file, move it to the BESA PC. You should now be able to read this file with BESA. To do so, in the File Open Dialog Box, set the “Files of type” dropdown list to “EGI Formats(*.raw…”.&lt;br /&gt;
&lt;br /&gt;
If you do this, BESA will read all the events in the file, and assign trigger numbers to them (except the following, which are meaningless to BESA: CELL, SESS, bgin and TRSP).&lt;br /&gt;
&lt;br /&gt;
Optionally, you can control which events are read by BESA by creating a .trig file. A .trig file is a tab delimited file that contains one line for each event type that you want BESA to read. Each line consists of the name of the event, followed by a tab character, followed by a number between 1 and &amp;amp;lt;255? 256? 65535? 65536?&amp;amp;gt;. The following is an example of a .trig file:&lt;br /&gt;
&lt;br /&gt;
stnd 1&lt;br /&gt;
&lt;br /&gt;
targ 2&lt;br /&gt;
&lt;br /&gt;
resp 128&lt;br /&gt;
&lt;br /&gt;
You might want to use a .trig file if:&lt;br /&gt;
&lt;br /&gt;
* your data has a large number of events, and you don’t need most of them in BESA, or,&lt;br /&gt;
* you want to include events with any of these names: CELL, SESS, bgin and TRSP.&lt;br /&gt;
&lt;br /&gt;
To use a .trig file, just make sure that the file is in the same directory as your data file when you open the data file. In addition, the .trig file must be named either “detault.trig”, or &amp;amp;lt;your data file name&amp;amp;gt;.trig (eg “subject1.trig”).&lt;br /&gt;
&lt;br /&gt;
=== Loading Sensor Coordinates ===&lt;br /&gt;
&lt;br /&gt;
After you have opened the file, you must load the sensor coordinate files (File-&amp;amp;gt;”Head Surface Points and Sensors”-&amp;amp;gt;”Load Coordinate Files”. If want to use average sensor position files (as opposed to files individually digitized for your subject), use the files in “C:\Besa\Examples\Xtras\EEG Binary Formats\EGI” directory.&lt;br /&gt;
&lt;br /&gt;
If you have 256 channel data, use GSN256andRef.ela, and GSN257.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 128 channel data, use GSN128andRef.ela, and GSN129.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v1, use GSN64andRef.ela, and GSN65v1_0.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v2, use GSN64andRef.ela, and GSN65v2_0.sfp.&lt;br /&gt;
&lt;br /&gt;
You are now ready to do your ERP derivation in BESA.&lt;br /&gt;
&lt;br /&gt;
== Exporting Averaged ERP Data ==&lt;br /&gt;
&lt;br /&gt;
=== Export ===&lt;br /&gt;
&lt;br /&gt;
If you have derived your ERP in Net Station, and wish to export it to BESA for source localization, once again, use the File Export tool, exporting in the Epoch Marked Simple Binary File format. The following explains the options to use:&lt;br /&gt;
&lt;br /&gt;
(This explanation assumes that the data has been rereferenced during the ERP derivation process.)&lt;br /&gt;
&lt;br /&gt;
Since this data has been rereferenced, you should export the reference channel. In other words, check the “Export Reference Channel” checkbox.&lt;br /&gt;
&lt;br /&gt;
For averaged data, you need to export using floating point precision. Since the data has been calibrated during the ERP derivation process, it doesn’t matter what you do with the “Calibrate Data” checkbox. Set the name of the output file to append the extention “.raw”.&lt;br /&gt;
&lt;br /&gt;
When exporting averaged ERP data (or any Net Station data that has been categorized, for example segmented data), Net Station generates an additional file: &amp;amp;lt;your file name&amp;amp;gt;.epoc. This file contains the names of the conditions for each epoch in the data.&lt;br /&gt;
&lt;br /&gt;
=== Opening in BESA ===&lt;br /&gt;
&lt;br /&gt;
After you have generated the .raw file, move it, and the .epoc file, to the BESA PC, keeping both files in the same directory. You should now be able to read this file with BESA. To do so, in the File Open Dialog Box, set the “Files of type” dropdown list to “EGI Formats(*.raw…”.&lt;br /&gt;
&lt;br /&gt;
=== Loading Sensor Coordinates ===&lt;br /&gt;
&lt;br /&gt;
After you have opened the file, you must load the sensor coordinate files (File-&amp;amp;gt;”Head Surface Points and Sensors”-&amp;amp;gt;”Load Coordinate Files”. If want to use average sensor position files (as opposed to files individually digitized for your subject), use the files in “C:\Besa\Examples\Xtras\EEG Binary Formats\EGI” directory.&lt;br /&gt;
&lt;br /&gt;
If you have 256 channel data, use GSN257.ela, and GSN257.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 128 channel data, use GSN129.ela, and GSN129.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v1, use GSN65.ela, and GSN65v1_0.sfp.&lt;br /&gt;
&lt;br /&gt;
If you have 64 channel data v2, use GSN65.ela, and GSN65v2_0.sfp.&lt;br /&gt;
&lt;br /&gt;
You are now ready to do source analysis in BESA.&lt;br /&gt;
&lt;br /&gt;
[[Category:Setup]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data</id>
		<title>Using BESA to correct blink and EKG artifacts in MEG data</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Using_BESA_to_correct_blink_and_EKG_artifacts_in_MEG_data"/>
				<updated>2021-02-02T11:26:08Z</updated>
		
		<summary type="html">&lt;p&gt;Abinash: /* Sending the data to Source Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Standard or higher&lt;br /&gt;
|version = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using BESA to correct blink and EKG artifacts in MEG data =&lt;br /&gt;
&lt;br /&gt;
Eyeblinks and EKG cause large artifact signals in the magnetometer channels. The artifact correction facilities of BESA can correct these artifacts quite well. The procedure is quite simple for blinks but more complex for EKG. The following text outlines the procedures and current limitations of BESA for artifact correction.&lt;br /&gt;
&lt;br /&gt;
The principles of the artifact correction procedure are described in ''Berg, P., Scherg, M. (1994) A multiple source approach to the correction of eye artifacts. Electroenceph. clin. Neurophysiol, 90: 229-241''.&lt;br /&gt;
&lt;br /&gt;
In summary, the following steps are required:&lt;br /&gt;
&lt;br /&gt;
* Use pattern search and average to identify the latencies of blink/EKG signals in the raw data. Pattern search works best if you have recorded a vertical EOG and EKG with the MEG data, but it will also work on selected MEG channels, using the appropriate filters.&lt;br /&gt;
* A spatial PCA is performed on the average to identify the main topographies/components of the artifact signal. For blinks, only one topography is required. For EKG, two or three topographies may be required.&lt;br /&gt;
* The topographies/components are combined into a coefficient file (''*.atf''). Using the '''Artifact''' Menu, the ''atf'' file can be loaded and correction switched on. Contrary to the warning message displayed by the ERP module, averaging can be performed using artifact corrected data.&lt;br /&gt;
* When the average is loaded into the Source Analysis module, the artifact coefficients (saved in the average file) need to be activated. They will then be incorporated into source modelling using subspace projection (SSP – see also papers by Uusitalo et al.). In this case, SSP is equivalent to the “optimized correction method” described in Berg &amp;amp;amp; Scherg (1994).&lt;br /&gt;
&lt;br /&gt;
== Pattern search for blinks and EKG ==&lt;br /&gt;
&lt;br /&gt;
=== Eyeblinks ===&lt;br /&gt;
&lt;br /&gt;
# Select filters 0.5 – 8 Hz ('''Filters/Edit Filter Settings…'''). Make sure the low cutoff filter type is '''Forward'''! (This is to ensure that no contribution from the blink topography bleeds back into the baseline time interval).&lt;br /&gt;
# View Polygraphic signals only (press the '''Pgr''' button at the top right of the BESA window), so that the vertical EOG channel is displayed&lt;br /&gt;
# Define the search block from –100 ms to +400 ms ('''Edit/Default Block Epoch…''')&lt;br /&gt;
# Select Pattern Search ('''Search/Pattern''')&lt;br /&gt;
# Select Search Query ('''Search/Query''')&lt;br /&gt;
# Select Buffer 1 for averaging ('''Tags/Pattern 1''')&lt;br /&gt;
# Identify a clear blink signal on the vertical EOG channel. Right-click at the '''onset''' of the blink, and select '''Default Block''' in the dropdown menu. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(1).png|155x101px]]&lt;br /&gt;
# Click once on the VEOG channel label, so that a rightward arrow is displayed (ignore the correlation window that opens on the right): [[File:EKG_artifacts_in_MEG_data__(2).png|134x72px]]&lt;br /&gt;
# Press the '''SAW''' button (Search/Average/Write). BESA will start scanning through the file, and it will stop at each occurrence of a blink. Press “Yes” to accept. “No” to reject, or “Stop asking” to let BESA accept everything automatically. Save the result to a file name of your choice (e.g. ''name_artifact.fsg''), labelling the segment, e.g. “blink”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
# In contrast to blink averaging we use two steps: first, filters are set to enhance the EKG for pattern search. Second, the filters are opened up, and the average is repeated.&lt;br /&gt;
# Select filters 5-20 Hz. This should generate a fairly clear signal on the EKG.&lt;br /&gt;
# Set the default block epoch so that the R-wave and the T-wave are well inside the epoch. The setting used for blinks may be OK, but you may need to extend the post-cursor interval, e.g. from 400 to 500 ms.&lt;br /&gt;
# Proceed as with blinks, but selecting Buffer 2 for averaging ('''Tags/Pattern 2'''). Mark a block around the onset of an R-wave. The marked block should look something like this: [[File:EKG_artifacts_in_MEG_data__(3).png|129x89px]]&lt;br /&gt;
# Save the average in the same file as the averaged blinks, labelling the segment, e.g. “EKG”.&lt;br /&gt;
# Select filters 1-30 Hz. Select '''Search/Tagged Events''', and press '''SAW'''. This repeats the average using the tags that were identified during the first step. Opening up the filters ensures that the average includes more of the EKG signal.&lt;br /&gt;
&lt;br /&gt;
=== What to do if there is no VEOG or EKG channel ===&lt;br /&gt;
&lt;br /&gt;
The procedure is similar to the above, but you need to identify a MEG channel that displays the blink or EKG waveform clearly. You may need to experiment with filter settings to make the artifact pattern clearer (the filter settings described above are not fixed rules – you may find that other settings work better for pattern search). You may find the “Create Triggers from EMG/EEG” tool helpful for detecting EKG ('''ERP/Create Triggers from EMG/EEG…'''). See the BESA help file (tutorial on creating triggers).&lt;br /&gt;
&lt;br /&gt;
== Spatial PCA and the *.atf file ==&lt;br /&gt;
&lt;br /&gt;
Open the file in which you saved the averages (e.g. ''name_artifact.fsg''). Make sure that prestimulus baseline correction is switched on ('''Filters/Use Prestimulus Baseline''').&lt;br /&gt;
&lt;br /&gt;
=== Blinks ===&lt;br /&gt;
&lt;br /&gt;
# Mark the whole blink epoch: Right-click onto the epoch, and select '''Whole Segment'''.&lt;br /&gt;
# Select '''Artifact/Assign/Blink'''. The spatial PCA is computed, and the first spatial component is assigned to describe the blink. You may check if the correction works by selecting '''Artifact/Correct'''.&lt;br /&gt;
# The coefficients are saved automatically to a file with the same basename as the average, and the extension ''“.atf''”.&lt;br /&gt;
&lt;br /&gt;
=== EKG ===&lt;br /&gt;
&lt;br /&gt;
EKG coefficients are corrected analogously to blinks. A difference is that the topographic distribution of the EKG over the MEG sensors is more complex than that of blinks. It changes over time. The reasons for this are unclear, and may be due to movement of the heart (and its equivalent dipoles) over time, but also to ballistic effects: movement of the head due to blood flow.&lt;br /&gt;
&lt;br /&gt;
Since topographic distribution changes over time, more than one component is required for correction. We choose the number of components in the Artifact Select Dialog Box empirically: As a rule of thumb, if a component explains more than 5-10% of the variance of the averaged EKG signal, the component is included. Note that the number of components you select can also be changed when the coefficients are applied to the raw data.&lt;br /&gt;
&lt;br /&gt;
== Correcting the raw data ==&lt;br /&gt;
&lt;br /&gt;
* Switch back to the raw data file, and load the ''*.atf'' file you have created ('''Artifact/Load…''').&lt;br /&gt;
* Optionally, check that the artifact correction channels are visible (Artifact/View)&lt;br /&gt;
* Switch on artifact correction (Artifact/Correct).&lt;br /&gt;
* The figure on the next page shows the result of correction of channels A75-A148 on a three-second interval containing both EKG and eye activity. The blue label “1” marks the onset of a blink found during pattern search. The red “2” shows the onset of R-waves found during pattern search.&lt;br /&gt;
* Note that correction is quite good, but it is not perfect. In particular, there is some residual eye activity, e.g. around channels A91, A113, A131.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! '''uncorrected'''&lt;br /&gt;
! '''corrected'''&lt;br /&gt;
|-&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(4).png|57x57px]][[File:EKG_artifacts_in_MEG_data__(5).png|272x802px]]&lt;br /&gt;
| [[File:EKG_artifacts_in_MEG_data__(6).png|273x801px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Averaging the raw data ==&lt;br /&gt;
&lt;br /&gt;
You can leave correction on during data averaging. When you press the Average button, a warning dialog will appear:&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(7).png|539x124px]]&lt;br /&gt;
&lt;br /&gt;
You may select either option. Because of the recent installation of subspace projection (SSP) in the Source Module, the “distorted topographies” in the warning are no longer an issue for source analysis, provided SSP is switched on when the data are sent to the Source Module. The decision has consequences a) if you intend to analyze data waveform amplitudes and/or latencies, and b) if you intend to export the averages for analysis with other software.&lt;br /&gt;
&lt;br /&gt;
==== Option “Yes” – turn off artifact correction ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will include EKG and eye artifacts, but these artifacts will not cause epochs to be rejected. The same number of epochs will be included in the average whether or not “Yes” or “No” is chosen.&lt;br /&gt;
&lt;br /&gt;
You may load the correction coefficients (''*.atf'') for the average, and switch on artifact correction.&lt;br /&gt;
&lt;br /&gt;
==== Option “No” – leave artifact correction on ====&lt;br /&gt;
&lt;br /&gt;
The averaged data will be corrected. Each epoch is corrected before being included in the average.&lt;br /&gt;
&lt;br /&gt;
==== Artifact options: which correction model? ====&lt;br /&gt;
&lt;br /&gt;
The result of the correction on the raw data or the averaged data can be slightly different. The effects of correction will also vary, depending on the settings in '''Artifact/Options'''. These differences can be considered as consequences of variations in the “surrogate” or “adaptive” model of brain activity concurrent with the artifact activity (cf. Berg &amp;amp;amp; Scherg 1994). These differences lead to changes in the estimate of the amounts of artifact activity to be removed by correction. If you intend to use the data waveforms outside BESA, and if you don’t use SSP with the artifact coefficients, then the settings in '''Artifact/Options''' become important. In current versions of BESA, these settings are based on EEG amplitude levels. In Konstanz, we generally use the values shown on the right. Note that these values are '''irrelevant''' if we use SSP in Source Analysis.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(8).png|353x231px]]&lt;br /&gt;
&lt;br /&gt;
== Sending the data to Source Analysis ==&lt;br /&gt;
&lt;br /&gt;
When the average is generated, the correction coefficients are saved in the ''*.fsg'' file. Before you send the data to the Source Module, these coefficients must be '''activated'''.&lt;br /&gt;
&lt;br /&gt;
* If you averaged the corrected data, coefficients are already activated. This should be apparent from the red “corrected” displayed above the channel labels.&lt;br /&gt;
* If you averaged the uncorrected data, load the saved ''*.atf'' file ('''Artifact/Load…'''), and switch on correction ('''Artifact/Correct''').&lt;br /&gt;
&lt;br /&gt;
Then mark a time range and send the data to Source Analysis. At the right of the status bar, the text '''ART''' indicates that the artifact components are used in SSP.&lt;br /&gt;
&lt;br /&gt;
[[File:EKG_artifacts_in_MEG_data__(9).png|143x158px]]&lt;br /&gt;
&lt;br /&gt;
'''Alternatively, if you averaged the uncorrected data, load the average to Source Analysis, and then load the artifact coefficients as part of the dipole model (load or append solution, and use the dropdown list in the File Open box to select ''*.atf'' instead of ''*.bsa''). This approach has the advantage that the source waveforms of the spatial components show the contribution of eye and EKG activity to the model.'''&lt;br /&gt;
&lt;br /&gt;
This implicit application of SSP during Source Analysis is mathematically equivalent to the “optimizing” correction method (cf. Berg &amp;amp;amp; Scherg 1994): the topographies of the artifacts are implicitly incorporated into any dipole model.&lt;br /&gt;
&lt;br /&gt;
== Limitations of the correction method in BESA ==&lt;br /&gt;
&lt;br /&gt;
=== Bad channels ===&lt;br /&gt;
&lt;br /&gt;
The ''*.atf'' file contains a two-line header with a) the number of channels, and b) the channel labels. If these do not match with the current data file, artifact correction is not possible. Bad channels are marked (with an asterisk next to the label), and the corresponding coefficient is set to zero. The irritating, but logical, the consequence is that if a channel was excluded (defined as “bad”) when the coefficients were generated, it is not possible to make the channel “good” again.&lt;br /&gt;
&lt;br /&gt;
The solution is to regenerate the ''*.atf'' file, making sure the same bad channels are defined in the averaged artifact file as the to-be-corrected raw or average data file. You do not need to regenerate the artifact averages.&lt;br /&gt;
&lt;br /&gt;
EKG correction is difficult because the topographic distribution of EKG signals is close to some MEG distributions: for instance, we sometimes observe a considerable reduction in alpha amplitudes with EKG correction. For event-related averaging, an EKG correction is often unnecessary, because the EKG is not synchronized with the stimulus.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Data Import/Export]] [[Category:Preprocessing]] [[Category:Source Analysis]]&lt;/div&gt;</summary>
		<author><name>Abinash</name></author>	</entry>

	</feed>