<?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=Mateusz</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=Mateusz"/>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Special:Contributions/Mateusz"/>
		<updated>2026-04-30T03:58:44Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.10</generator>

	<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>2025-07-09T09:32:45Z</updated>
		
		<summary type="html">&lt;p&gt;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 = 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;
=== M-chip support ===&lt;br /&gt;
If you use Mac with ARM-based processors (Apple silicon) and [https://www.besa.de/home/downloads/besa-license-key/ BESA License Key] older than 3.0 some special configuration is needed for the license handling:&lt;br /&gt;
# Install the latest Mac drivers for HASP that you can find [https://supportportal.thalesgroup.com/csm?id=kb_search&amp;amp;u_products_available_in_portal_search=50303b92db852e00d298728dae96199d&amp;amp;query=kbcat_drivers_%26_runtime_packages&amp;amp;_runtime_packages here]&lt;br /&gt;
# Attach the dongle to the Mac (not a virtual machine)&lt;br /&gt;
# Go to Virtual machine, after installing BESA product, you can use it. The license shall be automatically detected (you are using network license hosted by Mac)&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;
You may experience some glitches in the source analysis 3D visualization. To solve it:&lt;br /&gt;
# Make sure that the virtual machine is shut down (Actions &amp;gt; Shut Down). If it is in a suspended state, please run it and then shut down (Actions &amp;gt; Shut Down).&lt;br /&gt;
# Go to the virtual machine configuration (see: https://kb.parallels.com/117287 ) and click &amp;quot;Hardware &amp;gt; Boot Order &amp;gt; Advanced Settings&amp;quot;.&lt;br /&gt;
# Paste the following text: video.gl3=2 and press OK&lt;br /&gt;
# Start Windows virtual machine&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>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=How_to_Use_BrainVision_Analyzer_with_BESA_Connectivity</id>
		<title>How to Use BrainVision Analyzer with BESA Connectivity</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=How_to_Use_BrainVision_Analyzer_with_BESA_Connectivity"/>
				<updated>2023-11-13T20:37:01Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: Created page with &amp;quot;{{BESAInfobox |title = Module information |module = BESA Connectivity |version = BESA Connectivity 1.0 or higher }}   == Note and general remarks== To transform data from Brai...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Connectivity&lt;br /&gt;
|version = BESA Connectivity 1.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Note and general remarks==&lt;br /&gt;
To transform data from BrainVision Analyzer you need to convert it using MATLAB. We assume that you have it already installed on your PC and BrainVision Analyzer is configured to work with it. You will also need this script from our github page:&lt;br /&gt;
https://github.com/BESA-GmbH/BESA-MATLAB-Scripts/blob/main/Additional_utilities/BESAConnectivityScripts/Analyzer_to_BESAConnectivity.m&lt;br /&gt;
You will also need these toolboxes:&lt;br /&gt;
https://github.com/BESA-GmbH/BESA-MATLAB-Scripts/tree/main/MATLAB2BESA&lt;br /&gt;
&lt;br /&gt;
== What to do in BrainVision Analyzer==&lt;br /&gt;
You need to prepare data that is in segments. You can of course apply any filtration and data processing beforehand. Then you export segments to matlab using Brain Voyager interface&lt;br /&gt;
&lt;br /&gt;
== Adapt the script ==&lt;br /&gt;
Script Analyzer_to_BESAConnectivity.m needs to be adapted. The following lines should be changed:&lt;br /&gt;
*In line after &amp;quot;%% Add toolboxes&amp;quot; provide full path to MATLAB2BESA toolbox&lt;br /&gt;
*You may adapt where the resulting file will be saved by changing the line &amp;quot;FilePathName = [pwd '\BAtoBESA.generic'];&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Finalization ==&lt;br /&gt;
You just need to run the script just by either pressing Run in matlab toolbar or by calling &amp;quot;Analyzer_to_BESAConnectivity&amp;quot; command. &lt;br /&gt;
In BESA Connectivity you open the newly created file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Connectivity]] [[Category:Time-Frequency]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Supported_Data_Formats</id>
		<title>Supported Data Formats</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Supported_Data_Formats"/>
				<updated>2023-10-04T13:20:53Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
BESA Research supports most major EEG and MEG file formats. Most file format readers are written by ourselves, others are supplied by the manufacturers.&lt;br /&gt;
This document gives an overview of all the data formats that can be imported in BESA Research 6.1 or higher. If your file format cannot be found in this list, please contact us via our support form: [https://www.besa.de/support/support-page/ BESA support form]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;The readers are part of the product installations, and the latest readers are included in the product installations.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supported EEG data formats==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | File Format / Manufacturer / Software&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | File Extension&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; class=&amp;quot;unsortable&amp;quot; | File Formats Version&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; class=&amp;quot;unsortable&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
| Alpha-Trace (alpha-trace medical software)&lt;br /&gt;
| .alp&lt;br /&gt;
| tested up to v418-05&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| ASCII&lt;br /&gt;
| .avr .mul&lt;br /&gt;
| &lt;br /&gt;
| [http://wiki.besa.de/index.php?title=ASCII_File_Format ASCII File Format]&lt;br /&gt;
|-&lt;br /&gt;
| ATES *&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BDF (BioSemi)&lt;br /&gt;
| .bdf&lt;br /&gt;
| &lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_BioSemi_data_with_BESA Reading BioSemi data]&lt;br /&gt;
|-&lt;br /&gt;
| Beekeeper64 (Telefactor)&lt;br /&gt;
| .eeg .dat&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Bio-logic (Natus) *&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BrainAmp / BrainVision (Brain Products)&lt;br /&gt;
| .eeg .vhdr&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BrainLab (Schwarzer)&lt;br /&gt;
| .sig&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BrainStar (Schwind Medizintechnik)&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Cadwell *, ***&lt;br /&gt;
| .flex&lt;br /&gt;
| tested up to Arc API 2.1.106.0&lt;br /&gt;
| ARC API needs to be installed ***&lt;br /&gt;
|-&lt;br /&gt;
| Compumedics (ProFusion) *, **&lt;br /&gt;
| .sdy&lt;br /&gt;
| ProFusion EEG 4, 5&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| DCmes, PolyDC (MES)&lt;br /&gt;
| .dat&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Deltamed (Natus, Coherence) *&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Deltamed (Natus, Neurofile)&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Deymed (Truescan)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| EBNeuro (Galileo) *, **&lt;br /&gt;
| .gnt .set&lt;br /&gt;
| Galileo.NT, Galileo.NET 3.5&lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_EBNeuro_Files Reading EBNeuro Files]&lt;br /&gt;
|-&lt;br /&gt;
| EDF (European Data Format)&lt;br /&gt;
| .edf&lt;br /&gt;
| EDF, EDF+&lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_EDF_Files Reading EDF Files]&lt;br /&gt;
|-&lt;br /&gt;
| EEProbe (ANT)&lt;br /&gt;
| .cnt&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Electrical Geodesics, Inc. - Raw data format&lt;br /&gt;
| .raw .ses&lt;br /&gt;
| &lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_EGI_RAW_Files Reading EGI Raw Files]&lt;br /&gt;
|-&lt;br /&gt;
| Electrical Geodesics, Inc. - Metafile Format (EGI MFF) *&lt;br /&gt;
| .xml&lt;br /&gt;
| up to MFF v3&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| ERPSS *&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| g.Tec (Guger Technologies) *&lt;br /&gt;
| .hdf5&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Galileo (EBNeuro) *&lt;br /&gt;
| .nt&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Generic Reader (any ASCII formats; see BESA Program Help)&lt;br /&gt;
| .avr .mul&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Grass-Telefactor (Natus) *&lt;br /&gt;
| .ref&lt;br /&gt;
| up to Twin v3.1&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| InstEP *, ****&lt;br /&gt;
| .c .is .ia&lt;br /&gt;
| up to version 7.3 of the IWave Input/Output library&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Konstanz file format *&lt;br /&gt;
| .raw .sum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| ManScan interchange format (SAM) *&lt;br /&gt;
| .mbi&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Medtronic *&lt;br /&gt;
| .wg1&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| MEF (Multiscale Electrophysiology File) *&lt;br /&gt;
| .xml&lt;br /&gt;
| MEF 2.0&lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_MEF_Files Reading MEF Files]&lt;br /&gt;
|-&lt;br /&gt;
| Micromed (Natus) *&lt;br /&gt;
| .trc&lt;br /&gt;
| Micromed System98 EEG file (version 3 &amp;amp; 4)&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Neuralynx *&lt;br /&gt;
| .ncs&lt;br /&gt;
| &lt;br /&gt;
| requires BESA Research version 7.0 or higher&lt;br /&gt;
|-&lt;br /&gt;
| NeurOne (Bittium, formerly known as Mega Electronics) *&lt;br /&gt;
| .xml&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Neuronic *&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| NeuroScan&lt;br /&gt;
| .cnt .avg&lt;br /&gt;
| NeuroScan 3.x&lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_Neuroscan_Files Reading NeuroScan Files]]&lt;br /&gt;
|-&lt;br /&gt;
| NeuroScan Curry 7 *&lt;br /&gt;
| .rs3 .dap .dat .ce*&lt;br /&gt;
| Curry 6 and 7 files&lt;br /&gt;
| requires BESA Research version 7.0 or higher. See also [http://wiki.besa.de/index.php?title=Reading_Neuroscan_Files Reading NeuroScan Files]&lt;br /&gt;
|-&lt;br /&gt;
| NeuroScan Curry 8 *&lt;br /&gt;
| .dpa .cdt .ceo&lt;br /&gt;
| Curry 8 files&lt;br /&gt;
| requires BESA Research 7.1 or higher&lt;br /&gt;
|-&lt;br /&gt;
| NexStim&lt;br /&gt;
| .nxe&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Nicolet (Natus) *&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| NicoletOne / Nervus (Natus) *&lt;br /&gt;
| .e .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Nihon Kohden&lt;br /&gt;
| .eeg&lt;br /&gt;
| EEG-1100, EEG-1200, EEG-2100&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Philips MFF&lt;br /&gt;
| .mff&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Phoenix II (EMS) *&lt;br /&gt;
| s*.0 s*.1 …&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Stellate Systems - Harmonie (Natus) *, **&lt;br /&gt;
| .sig&lt;br /&gt;
| Harmonie 5.2c, 5.4, 6.1, 6.2, 7a&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Stellate Systems - Monitor (Natus) *, **&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Vangard (LaMont Medical Inc.) *&lt;br /&gt;
| B****, no extension&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| XDF *&lt;br /&gt;
| .xdf&lt;br /&gt;
| &lt;br /&gt;
| requires BESA Research 7.1 or higher&lt;br /&gt;
|-&lt;br /&gt;
| Natus NeuroWorks (former XLTEK)&lt;br /&gt;
| .eeg .erd&lt;br /&gt;
| up to v8.1&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If files are in one of these formats, they can be read directly and conversion is not required.&lt;br /&gt;
BESA Research also has a new, flexible interface for importing ASCII files which can be used in conjunction with the ASCII export functions of your software.&lt;br /&gt;
Any EEG format can be converted to the compressed BESA binary format, ASCII format, EDF+ or simple binary format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Install this reader using &amp;quot;''Install Additional Readers.htm''&amp;quot; in the &amp;quot;''Utilities\Additional Readers\''&amp;quot; subfolder.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;**&amp;lt;/nowiki&amp;gt; The EEG data format requires installation of the corresponding EEG system reader software or SDK.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;***&amp;lt;/nowiki&amp;gt; The Cadwell reader requires the installation of the Cadwell Arc API. If this API is not already installed on your computer, download it from the following link and install it on your computer: [https://my.hidrive.com/lnk/PFh5kbFb Link]. The API must be installed in the suggested default path on your C: drive.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;****&amp;lt;/nowiki&amp;gt; Please note that a valid license for the IWave library is required in order to be able to read InstEP files.&lt;br /&gt;
&lt;br /&gt;
==Supported MEG data formats==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | File Format / Manufacturer / Software&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | File Extension&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | File Formats Version&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
| ASCII&lt;br /&gt;
| .avr .mul&lt;br /&gt;
| &lt;br /&gt;
| [http://wiki.besa.de/index.php?title=ASCII_File_Format ASCII File Format]&lt;br /&gt;
|-&lt;br /&gt;
| BESA 2000 / FOCUS High Compression Format&lt;br /&gt;
| .foc .fsg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BTI (special export program exp2BESAbin in Unix system)&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| CTF&lt;br /&gt;
| .meg4&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Elekta Neuromag Functional Image File Format (FIFF)&lt;br /&gt;
| .fif&lt;br /&gt;
| FIFF v2.0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Ricoh *&lt;br /&gt;
| .con&lt;br /&gt;
|v3.0&lt;br /&gt;
|requires BESA Research 7.0 or higher &lt;br /&gt;
|-&lt;br /&gt;
| Yokogawa *&lt;br /&gt;
| .con .raw .ave .SQD &lt;br /&gt;
|up to version 2 &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Install this reader using &amp;quot;''Install Additional Readers.htm''&amp;quot; in the &amp;quot;''Utilities\Additional Readers\''&amp;quot; subfolder.&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Supported_Data_Formats</id>
		<title>Supported Data Formats</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Supported_Data_Formats"/>
				<updated>2023-10-04T13:19:58Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
BESA Research supports most major EEG and MEG file formats. Most file format readers are written by ourselves, others are supplied by the manufacturers.&lt;br /&gt;
This document gives an overview of all the data formats that can be imported in BESA Research 6.1 or higher. If your file format cannot be found in this list, please contact us via our support form: [https://www.besa.de/support/support-page/ BESA support form]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;The readers are part of the product installations, and the latest readers are included in the product installations.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Supported EEG data formats==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | File Format / Manufacturer / Software&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | File Extension&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; class=&amp;quot;unsortable&amp;quot; | File Formats Version&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; class=&amp;quot;unsortable&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
| Alpha-Trace (alpha-trace medical software)&lt;br /&gt;
| .alp&lt;br /&gt;
| tested up to v418-05&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| ASCII&lt;br /&gt;
| .avr .mul&lt;br /&gt;
| &lt;br /&gt;
| [http://wiki.besa.de/index.php?title=ASCII_File_Format ASCII File Format]&lt;br /&gt;
|-&lt;br /&gt;
| ATES *&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BDF (BioSemi)&lt;br /&gt;
| .bdf&lt;br /&gt;
| &lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_BioSemi_data_with_BESA Reading BioSemi data]&lt;br /&gt;
|-&lt;br /&gt;
| Beekeeper64 (Telefactor)&lt;br /&gt;
| .eeg .dat&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Bio-logic (Natus) *&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BrainAmp / BrainVision (Brain Products)&lt;br /&gt;
| .eeg .vhdr&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BrainLab (Schwarzer)&lt;br /&gt;
| .sig&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BrainStar (Schwind Medizintechnik)&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Cadwell *, ***&lt;br /&gt;
| .flex&lt;br /&gt;
| tested up to Arc API 2.1.106.0&lt;br /&gt;
| ARC API needs to be installed ***&lt;br /&gt;
|-&lt;br /&gt;
| Compumedics (ProFusion) *, **&lt;br /&gt;
| .sdy&lt;br /&gt;
| ProFusion EEG 4, 5&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| DCmes, PolyDC (MES)&lt;br /&gt;
| .dat&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Deltamed (Natus, Coherence) *&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Deltamed (Natus, Neurofile)&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Deymed (Truescan)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| EBNeuro (Galileo) *, **&lt;br /&gt;
| .gnt .set&lt;br /&gt;
| Galileo.NT, Galileo.NET 3.5&lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_EBNeuro_Files Reading EBNeuro Files]&lt;br /&gt;
|-&lt;br /&gt;
| EDF (European Data Format)&lt;br /&gt;
| .edf&lt;br /&gt;
| EDF, EDF+&lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_EDF_Files Reading EDF Files]&lt;br /&gt;
|-&lt;br /&gt;
| EEProbe (ANT)&lt;br /&gt;
| .cnt&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Electrical Geodesics, Inc. - Raw data format&lt;br /&gt;
| .raw .ses&lt;br /&gt;
| &lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_EGI_RAW_Files Reading EGI Raw Files]&lt;br /&gt;
|-&lt;br /&gt;
| Electrical Geodesics, Inc. - Metafile Format (EGI MFF) *&lt;br /&gt;
| .xml&lt;br /&gt;
| up to MFF v3&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| ERPSS *&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| g.Tec (Guger Technologies) *&lt;br /&gt;
| .hdf5&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Galileo (EBNeuro) *&lt;br /&gt;
| .nt&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Generic Reader (any ASCII formats; see BESA Program Help)&lt;br /&gt;
| .avr .mul&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Grass-Telefactor (Natus) *&lt;br /&gt;
| .ref&lt;br /&gt;
| up to Twin v3.1&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| InstEP *, ****&lt;br /&gt;
| .c .is .ia&lt;br /&gt;
| up to version 7.3 of the IWave Input/Output library&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Konstanz file format *&lt;br /&gt;
| .raw .sum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| ManScan interchange format (SAM) *&lt;br /&gt;
| .mbi&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Medtronic *&lt;br /&gt;
| .wg1&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| MEF (Multiscale Electrophysiology File) *&lt;br /&gt;
| .xml&lt;br /&gt;
| MEF 2.0&lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_MEF_Files Reading MEF Files]&lt;br /&gt;
|-&lt;br /&gt;
| Micromed (Natus) *&lt;br /&gt;
| .trc&lt;br /&gt;
| Micromed System98 EEG file (version 3 &amp;amp; 4)&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Neuralynx *&lt;br /&gt;
| .ncs&lt;br /&gt;
| &lt;br /&gt;
| requires BESA Research version 7.0 or higher&lt;br /&gt;
|-&lt;br /&gt;
| NeurOne (Bittium, formerly known as Mega Electronics) *&lt;br /&gt;
| .xml&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Neuronic *&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| NeuroScan&lt;br /&gt;
| .cnt .avg&lt;br /&gt;
| NeuroScan 3.x&lt;br /&gt;
| [http://wiki.besa.de/index.php?title=Reading_Neuroscan_Files Reading NeuroScan Files]]&lt;br /&gt;
|-&lt;br /&gt;
| NeuroScan Curry 7 *&lt;br /&gt;
| .rs3 .dap .dat .ce*&lt;br /&gt;
| Curry 6 and 7 files&lt;br /&gt;
| requires BESA Research version 7.0 or higher. See also [http://wiki.besa.de/index.php?title=Reading_Neuroscan_Files Reading NeuroScan Files]&lt;br /&gt;
|-&lt;br /&gt;
| NeuroScan Curry 8 *&lt;br /&gt;
| .dpa .cdt .ceo&lt;br /&gt;
| Curry 8 files&lt;br /&gt;
| requires BESA Research 7.1 or higher&lt;br /&gt;
|-&lt;br /&gt;
| NexStim&lt;br /&gt;
| .nxe&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Nicolet (Natus) *&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| NicoletOne / Nervus (Natus) *&lt;br /&gt;
| .e .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Nihon Kohden&lt;br /&gt;
| .eeg&lt;br /&gt;
| EEG-1100, EEG-1200, EEG-2100&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Philips MFF&lt;br /&gt;
| .mff&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Phoenix II (EMS) *&lt;br /&gt;
| s*.0 s*.1 …&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Stellate Systems - Harmonie (Natus) *, **&lt;br /&gt;
| .sig&lt;br /&gt;
| Harmonie 5.2c, 5.4, 6.1, 6.2, 7a&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Stellate Systems - Monitor (Natus) *, **&lt;br /&gt;
| .eeg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Vangard (LaMont Medical Inc.) *&lt;br /&gt;
| B****, no extension&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| XDF *&lt;br /&gt;
| .xdf&lt;br /&gt;
| &lt;br /&gt;
| requires BESA Research 7.1 or higher&lt;br /&gt;
|-&lt;br /&gt;
| Natus NeuroWorks(former XLTEK)&lt;br /&gt;
| .eeg .erd&lt;br /&gt;
| up to v8.1&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If files are in one of these formats, they can be read directly and conversion is not required.&lt;br /&gt;
BESA Research also has a new, flexible interface for importing ASCII files which can be used in conjunction with the ASCII export functions of your software.&lt;br /&gt;
Any EEG format can be converted to the compressed BESA binary format, ASCII format, EDF+ or simple binary format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Install this reader using &amp;quot;''Install Additional Readers.htm''&amp;quot; in the &amp;quot;''Utilities\Additional Readers\''&amp;quot; subfolder.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;**&amp;lt;/nowiki&amp;gt; The EEG data format requires installation of the corresponding EEG system reader software or SDK.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;***&amp;lt;/nowiki&amp;gt; The Cadwell reader requires the installation of the Cadwell Arc API. If this API is not already installed on your computer, download it from the following link and install it on your computer: [https://my.hidrive.com/lnk/PFh5kbFb Link]. The API must be installed in the suggested default path on your C: drive.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;****&amp;lt;/nowiki&amp;gt; Please note that a valid license for the IWave library is required in order to be able to read InstEP files.&lt;br /&gt;
&lt;br /&gt;
==Supported MEG data formats==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | File Format / Manufacturer / Software&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | File Extension&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | File Formats Version&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
| ASCII&lt;br /&gt;
| .avr .mul&lt;br /&gt;
| &lt;br /&gt;
| [http://wiki.besa.de/index.php?title=ASCII_File_Format ASCII File Format]&lt;br /&gt;
|-&lt;br /&gt;
| BESA 2000 / FOCUS High Compression Format&lt;br /&gt;
| .foc .fsg&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BTI (special export program exp2BESAbin in Unix system)&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| CTF&lt;br /&gt;
| .meg4&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Elekta Neuromag Functional Image File Format (FIFF)&lt;br /&gt;
| .fif&lt;br /&gt;
| FIFF v2.0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Ricoh *&lt;br /&gt;
| .con&lt;br /&gt;
|v3.0&lt;br /&gt;
|requires BESA Research 7.0 or higher &lt;br /&gt;
|-&lt;br /&gt;
| Yokogawa *&lt;br /&gt;
| .con .raw .ave .SQD &lt;br /&gt;
|up to version 2 &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Install this reader using &amp;quot;''Install Additional Readers.htm''&amp;quot; in the &amp;quot;''Utilities\Additional Readers\''&amp;quot; subfolder.&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Pipeline_for_simultaneous_EEG-fMRI_recording</id>
		<title>Pipeline for simultaneous EEG-fMRI recording</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Pipeline_for_simultaneous_EEG-fMRI_recording"/>
				<updated>2022-03-10T09:34:04Z</updated>
		
		<summary type="html">&lt;p&gt;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 = 7.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=Pipeline for simultaneous EEG-fMRI recording=&lt;br /&gt;
== Before you start ==&lt;br /&gt;
 &lt;br /&gt;
* Check if you have a clock synchronization between EEG and MRI systems (Abreu et al. 2018)&lt;br /&gt;
* Be sure that you have jitter between trials in ERP experiment (i.e. random value of ±200ms). Some further guidelines about paradigm creation can be found in (Rusiniak et al. 20013a)&lt;br /&gt;
* Try to limit subject movement to minimum.&lt;br /&gt;
* Make sure electrode to skin impedance is as low as possible.&lt;br /&gt;
* Design EEG-fMRI recording session to be long enough for proper artifact creation. Usually the experiment should last at least 6 minutes.&lt;br /&gt;
* Especially for the first few registrations repeat the experiment outside of the bore to compare results.&lt;br /&gt;
* You may try to adjust your fMRI EPI sequence parameters so the main imaging artifact frequency will not be in the main scope of brain signal frequency that is going to be evaluated (Rusiniak et al. 2013b)&lt;br /&gt;
&lt;br /&gt;
The artifact frequency and its harmonics can be easily assessed using the following equation: &amp;lt;math&amp;gt;f_x=(x+1)/TR&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;f_x&amp;lt;/math&amp;gt; is the harmonic frequency, &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is the harmonic number, and TR stands for Repetition Time of fMRI volume acquisition.&lt;br /&gt;
&lt;br /&gt;
==Pipeline overview==&lt;br /&gt;
The recommended pipeline (Rusiniak et al. 2022) of processing EEG data registered during fMRI session looks as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:EEG-fMRI pipeline.png]]&lt;br /&gt;
&lt;br /&gt;
'''Please note that some steps are grouped with colors:'''&lt;br /&gt;
* orange color indicates steps that are part of typical processing of ERP data.&lt;br /&gt;
* blue color indicates optional, yet strongly recommended EEG-MRI data co-registration. &lt;br /&gt;
* yellow color marks the steps related to fMRI gradient artifact removal&lt;br /&gt;
* green steps are reserved for BCG (and blink) artifact correction&lt;br /&gt;
* violet color indicates steps for time-frequency analysis. Here also information about rejected epochs is provided for the averaging purpose.&lt;br /&gt;
&lt;br /&gt;
==fMRI gradient removal==&lt;br /&gt;
Please note that you need hardware clock synchronization between EEG equipment and MRI scanner before removing the fMRI gradient artifact. Do not perform any sampling rate change (especially do not downsample data!) before performing this preprocessing step. Clock synchronization assures alignment between triggers present in EEG data and the start of fMRI volume acquisition as well as the consistent span between samples containing the artifact. That means that every epoch containing fMRI-induced artifact is identical. &lt;br /&gt;
To remove fMRI gradient select the menu entry '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Artifact\fMRI artifact...&amp;lt;/span&amp;gt;'''. The following dialog box will appear:&lt;br /&gt;
&lt;br /&gt;
[[File:FMRI_dialogbox.PNG]]&lt;br /&gt;
&lt;br /&gt;
Some of the parameters are strongly dependent on fMRI acquisition:&lt;br /&gt;
* Length of fMRI volume - it should be exactly the time of volume acquisition (the time when MR gradients are ON for one volume acquisition). For continuous fMRI sessions, this value is automatically detected. If you use sparse acquisition (between fMRI volumes there is a short period of silence), use the time of volume acquisition parameter.   &lt;br /&gt;
* fMRI trigger code - code in the EEG recording provided by MR scanner.&lt;br /&gt;
* Delay between marker and start of volume acquisition - a delay between marker in EEG provided by MR scanner and the real start of a fMRI volume acquisition.  This value can be also used if a sparse acquisition is used and scanning starts with some delays &lt;br /&gt;
* Number of scans to skip - if dummy scans (MR volumes acquired to stabilize magnetization) have corresponding markers in EEG data adjust this value to match the number of real volumes used for fMRI analysis.&lt;br /&gt;
* Realignment file - direct output file from first step of fMRI analysis (realignment). We support native realignment file as generated by SPM, FSL, AFNI and Brainvoyager.&lt;br /&gt;
&lt;br /&gt;
Other parameters should be carefully selected depending on the data:&lt;br /&gt;
* Number of artifact occurrence averages - The default value is 16. That means that 8 preceding and 8 proceeding artifact occurrences are used to create the averaged template. Note that if an odd number is used (ie. 17) the signal from the volume that is being currently corrected is also used for averaging. If a larger number is selected then the artifact is more stable and more differentiated from EEG data. However, if there is a lot of movement during the recording session the artifact template will be incorrect. A smaller number of artifact occurrences for averaging or more advanced methods of artifact removal should be selected in such situations.&lt;br /&gt;
* Movement threshold - this parameter is only used for two advanced methods: ''Allen et al. 2000 Modified'' and ''Moosmann et al. 2009''. When changing this value check how the template creation matrix looks. If you note that the matrix is highly segmented (as in the below example) you might consider increasing the threshold value.&lt;br /&gt;
&lt;br /&gt;
[[File:FMRI_distorted_matrix.PNG]]&lt;br /&gt;
&lt;br /&gt;
If you wish you can downsample data and export file with fMRI artifact gradient removed after using the aforementioned tool by pressing the '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;WrS&amp;lt;/span&amp;gt;''' button:&lt;br /&gt;
&lt;br /&gt;
[[file:FMRI export.PNG]]&lt;br /&gt;
&lt;br /&gt;
==BCG artifact correction==&lt;br /&gt;
The recommended BCG artifact correction method was evaluated and described by Rusinak et al.(2022). &lt;br /&gt;
&lt;br /&gt;
First, scroll through the data and mark bad electrodes and bad blocks of data. Note that especially at the beginning of the recording there might be fragments of data still contaminated with an fMRI gradient artifact, as shown below. This is the correct behavior since the MRI machine use so-called dummy scans that are not for data collection but intended for magnetization stabilization. These volumes are also not usually associated with triggers in the data. If you use a paradigm it should start after these scans. The most typical approach is to start stimuli presentation after the fMRI session starts (experiment should be triggered by MRI scanner).&lt;br /&gt;
&lt;br /&gt;
[[File:FMRI dummy.PNG|800px]]  &lt;br /&gt;
&lt;br /&gt;
===Recommendation for artifact template creation===&lt;br /&gt;
For BCG artifact removal we recommend using the PCA-based template creation. The ICA approach is a bit difficult for this matter since the BCG artifact is a complex signal distortion (constituted usually from more than three components). Also, the main assumption of ICA is violated - components are dependent rather than independent. Keep in mind that the BCG artifact is induced by the Hall effect, pulsating skin, and head movement. All of these phenomena are related to the heartbeat. On top of that, the part related to movement can consist of up to six components in the worst scenario (head movement and head rotation, both possible in three dimensions). &lt;br /&gt;
===How to create the template===&lt;br /&gt;
&lt;br /&gt;
Before attempting to create the artifact template, it is wise to set a filter to match the artifact frequency. For BCG, the following filter settings should be sufficient:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter &lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Cutoff frequency&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter slope&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter type&lt;br /&gt;
|-&lt;br /&gt;
| Low Cutoff&lt;br /&gt;
| 1&lt;br /&gt;
| zero phase&lt;br /&gt;
| 12 dB/oct&lt;br /&gt;
|-&lt;br /&gt;
| High Cutoff&lt;br /&gt;
| 20&lt;br /&gt;
| zero phase&lt;br /&gt;
| 24 dB/oct&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mark a block of data where BCG is clearly noticeable. You can either use an EKG channel or just all channels as the BCG is very prominent (check the example below). If you decide to use an EKG channel remember that the BCG artifact starts around 200-300 ms after the QRS complex visible in EKG. &lt;br /&gt;
&lt;br /&gt;
[[File:Fmri BCG.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
Go to menu '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Search&amp;lt;/span&amp;gt;''' and verify if '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Search, Average, View&amp;lt;/span&amp;gt;''' option is checked. If not, please enable it. &lt;br /&gt;
&lt;br /&gt;
Press the '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;SAV&amp;lt;/span&amp;gt;''' button in the toolbar to start creation of the artifact template. In the displayed dialog use settings as below to perform searching for artifact occurrences similar to the selected block, using all channels with a criterion for similarity of 65% correlation, after applying predefined filters. When you press OK, the search will start. &lt;br /&gt;
&lt;br /&gt;
[[File:FMRI SaV.PNG]]&lt;br /&gt;
&lt;br /&gt;
When the search is finished you will see the averaged artifact in a buffer on the left side of the data window, as shown below. If you start scrolling through data the averaged block disappears. You can switch it on at any time using the menu entry '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;View/Averaged Buffers&amp;lt;/span&amp;gt;'''. Note that you have blue vertical lines (if you selected to assign the BCG artifacts to pattern 1) in the event bar at the bottom of the screen. For good artifact correction, they should cover almost the whole file. Also, at the bottom of the averaged buffer display, you can see the number of averages (277 for example).  Make sure that this number is relatively large to be sure the artifact template is correctly created.  &lt;br /&gt;
&lt;br /&gt;
[[File:FMRI BCG averaged.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
===How to select the correct number of components for artifact correction===&lt;br /&gt;
Finally click the right mouse button over the averaged buffer and select '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Whole Segment&amp;lt;/span&amp;gt;'''. Click again with the right mouse button over the yellow marked area and select '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Define Artifact Topography&amp;lt;/span&amp;gt;'''. A new dialog will pop up. Check the EKG box and select the number of components used for artifact correction. The component number is followed by a number indicating how much signal variability is explained by the component, expressed in percentage. A question without an answer is how many components should be reduced since it really depends on the data. As a good starting point you may select all components that explain more than 1% of the BCG variance (so basically select the first number with variance lower than 1% - as in the example below 5(0.68)). Note that data will be automatically updated to the current settings. You can adjust this number at any further stage of data processing.&lt;br /&gt;
&lt;br /&gt;
[[File:FMRI components.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Automated BCG artifact removal==&lt;br /&gt;
The described above approach was automated by the batch script located in &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;''C:\Users\Public\Documents\BESA\Research_7_1\Scripts\Batch\BCG_removal.bbat''&amp;lt;/span&amp;gt;, as part of every installation. You just need to mark example BCG artifact by Pattern 1 (right click on the pattern start and click '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Pattern 1&amp;lt;/span&amp;gt;'''. Then start batch by pressing '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Bat&amp;lt;/span&amp;gt;''' button, select the aforementioned script and press '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Run&amp;lt;/span&amp;gt;'''.&lt;br /&gt;
&lt;br /&gt;
==Final data processing==&lt;br /&gt;
&lt;br /&gt;
If needed you can also perform blink artifact correction using an approach similar to the EKG reduction (but select only one component at the final stage, since it is a very well-established artifact). &lt;br /&gt;
&lt;br /&gt;
Now you can proceed with further data processing. There are some minor differences in comparison with the general BESA pipeline:&lt;br /&gt;
* if you want to perform averaging you will be similarly asked if you want to turn off artifact correction. Please do so, by pressing '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt;''' button. The artifact correction should be turned on again just after averaging. When the averaged file is open go to menu '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Artifact/Load...&amp;lt;/span&amp;gt;''' and select the file with the exact name of your data file but with extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;.atf&amp;lt;/span&amp;gt;. Once the artifact coefficient file is loaded, go to menu '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Artifact\Options&amp;lt;/span&amp;gt;''' and change the method of brain activity modeling to ''Surrogate''. Please verify if the selected number of artifact components used for reduction can be lowered. &lt;br /&gt;
&lt;br /&gt;
=== Source analysis (requires BESA Research Standard or higher ===&lt;br /&gt;
* As you might have noticed in other tutorials, we generally recommend performing source localization while artifact correction is off, and load artifact coefficients directly to the source analysis module. For EEG-fMRI data however it is acceptable to use artifact corrected data as input to the source analysis module.&lt;br /&gt;
* if you want to perform '''Time-domain beamformer''' accessed from ERP module (average tab) you will be prompted if artifact correction should be turned off. We recommend to perform beamformer with artifact correction off, but for EEG-fMRI data set please keep it on (press '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;''' button), since the large BCG artifact will affect results.&lt;br /&gt;
&lt;br /&gt;
==Good practice==&lt;br /&gt;
Please keep in mind that simultaneous EEG-fMRI recording is a difficult yet powerful technique. The following rules could help one to perform a successful experiment:&lt;br /&gt;
* Remember that proper '''EEG and MRI hardware clock synchronization''' is essential for fMRI gradient artifact removal. BESA Research internally performs checks if the synchronization is sufficient however it is the user's responsibility to maintain the hardware configuration. Under any circumstances '''do not change EEG data sampling rate''' prior to the fMRI gradient removal procedure.   &lt;br /&gt;
* For an ERP experiment remember to introduce temporal '''jitter between trials''' (e.g. a random value in the range of ±200 ms). Also, applying a pure EEG or a pure fMRI paradigm will probably have the effect that one of the modalities will not show satisfying results. Proper paradigm preparation is essential for success. Some further guidelines can be found here: (Rusiniak et al., 2013a).&lt;br /&gt;
* Inform your subject how important it is '''not to move'''.&lt;br /&gt;
* Keep electrode to skin '''impedance as low as possible'''.&lt;br /&gt;
* The EEG-fMRI recording session should be long enough to allow for appropriate artifact template creation. Usually, the experiment should '''last at least 6 minutes'''.&lt;br /&gt;
* At the same time tries to '''limit the time of experiment to a minimum''' and preferably perform EEG-fMRI registration before other sequences to limit movement due to an inconvenient supine position.&lt;br /&gt;
* From the standard position, move the '''subject about 4 cm towards the caudal direction''' to reduce artifacts: The MRI laser crosshair should be not in the Nasion position but in the middle of the forehead (Mullinger et al., 2011).&lt;br /&gt;
* Especially for the first few registrations '''repeat the experiment outside of the MR bore''' to compare results.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* Abreu, R., Leal, A., Figueiredo, P., 2018. EEG-Informed fMRI: A Review of Data Analysis Methods. Front. Hum. Neurosci. 12, 29. https://doi.org/10.3389/fnhum.2018.00029&lt;br /&gt;
* Allen, P.J., Josephs, O., Turner, R., 2000. A Method for Removing Imaging Artifact from Continuous EEG Recorded during Functional MRI. NeuroImage 12, 230–239. https://doi.org/10.1006/nimg.2000.0599&lt;br /&gt;
* Moosmann, M., Schönfelder, V.H., Specht, K., Scheeringa, R., Nordby, H., Hugdahl, K., 2009. Realignment parameter-informed artefact correction for simultaneous EEG–fMRI recordings. NeuroImage 45, 1144–1150. https://doi.org/10.1016/j.neuroimage.2009.01.024&lt;br /&gt;
* Mullinger, K.J., Yan, W.X., Bowtell, R., 2011. Reducing the gradient artefact in simultaneous EEG-fMRI by adjusting the subject’s axial position. NeuroImage 54, 1942–1950.&lt;br /&gt;
* Rusiniak, M., Lewandowska, M., Wolak, T., Pluta, A., Milner, R., Ganc, M., Włodarczyk, A., Senderski, A., Śliwa, L., Skarżyński, H., 2013a. A modified oddball paradigm for investigation of neural correlates of attention: a simultaneous ERP–fMRI study. Magn. Reson. Mater. Phys. Biol. Med. 26, 511–526. https://doi.org/10.1007/s10334-013-0374-7&lt;br /&gt;
* Rusiniak, M., Wolak, T., Lewandowska, M., Cieśla, K., Skarzynski, H., 2013b. The relation between EPI sequence parameters and electroencephalographic data during simultaneus EEG-fMRI registration: an initial report., in: ESMRMB 2013 Congress, Book of Abstracts, Saturday. Presented at the ESMRMB, Springer, Toulouse, p. 661. https://doi.org/10.1007/s10334-013-0384-5&lt;br /&gt;
* Rusiniak, M., Bornfleth, H., Cho, J.-H., Wolak, T., Ille, N., Berg, P., Scherg, M., 2022. EEG-fMRI: Ballistocardiogram Artifact Reduction by Surrogate Method for Improved Source Localization. Frontiers in Neuroscience 16. https://doi.org/10.3389/fnins.2022.842420&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]] [[Category:Preprocessing]] [[Category:Source Analysis]] [[Category: MRI]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Pipeline_for_simultaneous_EEG-fMRI_recording</id>
		<title>Pipeline for simultaneous EEG-fMRI recording</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Pipeline_for_simultaneous_EEG-fMRI_recording"/>
				<updated>2022-03-10T08:24:07Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: /* Pipeline overview */&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 = 7.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=Pipeline for simultaneous EEG-fMRI recording=&lt;br /&gt;
== Before you start ==&lt;br /&gt;
 &lt;br /&gt;
* Check if you have a clock synchronization between EEG and MRI systems&lt;br /&gt;
* Be sure that you have jitter between trials in ERP experiment (i.e. random value of ±200ms). Some further guidelines about paradigm creation can be found here: (Rusiniak et al., 2013a).&lt;br /&gt;
* Try to limit subject movement to minimum.&lt;br /&gt;
* Make sure electrode to skin impedance is as low as possible.&lt;br /&gt;
* Design EEG-fMRI recording session to be long enough for proper artifact creation. Usually the experiment should last at least 6 minutes.&lt;br /&gt;
* Especially for the first few registrations repeat the experiment outside of the bore to compare results. &lt;br /&gt;
&lt;br /&gt;
==Pipeline overview==&lt;br /&gt;
The recommended pipeline &amp;lt;ref&amp;gt;{{harvtxt|Rusiniak et al.|2022}}&amp;lt;/ref&amp;gt; of processing EEG data registered during fMRI session looks as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:EEG-fMRI pipeline.png]]&lt;br /&gt;
&lt;br /&gt;
'''Please note that some steps are grouped with colors:'''&lt;br /&gt;
* orange color indicates steps that are part of typical processing of ERP data.&lt;br /&gt;
* blue color indicates optional, yet strongly recommended EEG-MRI data co-registration. &lt;br /&gt;
* yellow color marks the steps related to fMRI gradient artifact removal&lt;br /&gt;
* green steps are reserved for BCG (and blink) artifact correction&lt;br /&gt;
* violet color indicates steps for time-frequency analysis. Here also information about rejected epochs is provided for averaging purpose.&lt;br /&gt;
&lt;br /&gt;
==fMRI gradient removal==&lt;br /&gt;
Please note that you need hardware clock synchronization between EEG equipment and MRI scanner before removing fMRI gradient artifact. Do not perform any sampling rate change (especially do not downsample data!) before performing this preprocessing step. Clock synchronization assures alignment between triggers present in EEG data and start of fMRI volume acquisition as well as consistent span between samples containing artifact. That means that every epoch containing fMRI induced artifact is identical. &lt;br /&gt;
To remove fMRI gradient select the menu entry '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Artifact\fMRI artifact...&amp;lt;/span&amp;gt;'''. The following dialog box will appear:&lt;br /&gt;
&lt;br /&gt;
[[File:FMRI_dialogbox.PNG]]&lt;br /&gt;
&lt;br /&gt;
Some of the parameters are strongly dependent on fMRI acquisition:&lt;br /&gt;
* Length of fMRI volume - it should be exactly the time of volume acquisition (time when MR gradients are ON for one volume acquisition). For continuous fMRI sessions this value is automatically detected. If you use sparse acquisition (between fMRI volumes there is a short period of silence), use time of volume acquisition parameter.   &lt;br /&gt;
* fMRI trigger code - code in the EEG recording provided by MR scanner.&lt;br /&gt;
* Delay between marker and start of volume acquisition - a delay between marker in EEG provided by MR scanner and real start of fMRI volume acquisition.  This value can be also used if sparse acquistion is used and scanning starts with some delays &lt;br /&gt;
* Number of scans to skip - if dummy scans (MR volumes acquired to stabilize magnetization) have corresponding markers in EEG data adjust this value to match the number of real volumes used for fMRI analysis.&lt;br /&gt;
* Realignment file - direct output file from first step of fMRI analysis (realignment). We support native realignment file as generated by SPM, FSL, AFNI and Brainvoyager.&lt;br /&gt;
&lt;br /&gt;
Other parameters should be carefully selected depending on the data:&lt;br /&gt;
* Number of artifact occurrence averages - The default value is 16. That means that 8 preceding and 8 proceeding artifact occurrences are used to create the averaged template. Note that if an odd number is used (ie. 17) the signal from the volume that is being currently corrected is also used for averaging. If a larger number is selected then the artifact is more stable and more differentiated from EEG data. However if there is a lot of movement during the recording session the artifact template will be incorrect. A smaller number of artifact occurrences for averaging or more advanced methods of artifact removal should be selected in such situations.&lt;br /&gt;
* Movement threshold - this parameter is only used for two advanced methods: ''Allen et al. 2000 Modified'' and ''Moosmann et al. 2009''. When changing this value check how the template creation matrix looks. If you note that the matrix is highly segmented (as in the below example) you might consider increasing the threshold value.&lt;br /&gt;
&lt;br /&gt;
[[File:FMRI_distorted_matrix.PNG]]&lt;br /&gt;
&lt;br /&gt;
If you wish you can downsample data and export file with fMRI artifact gradient removed after using the aforementioned tool by pressing the '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;WrS&amp;lt;/span&amp;gt;''' button:&lt;br /&gt;
&lt;br /&gt;
[[file:FMRI export.PNG]]&lt;br /&gt;
&lt;br /&gt;
==BCG artifact correction==&lt;br /&gt;
First scroll through the data and mark bad electrodes and bad blocks of data. Note that especially at the beginning of the recording there might be fragments of data still contaminated with an fMRI gradient artifact, as shown below. This is the correct behavior since the MRI machine use so-called dummy scans that are not for data collection but intended for magnetization stabilization. These volumes are also not usually associated with triggers in the data. If you use a paradigm it should start after these scans. The most typical approach is to start stimuli presentation after the fMRI session starts (experiment should be triggered by MRI scanner).&lt;br /&gt;
&lt;br /&gt;
[[File:FMRI dummy.PNG|800px]]  &lt;br /&gt;
&lt;br /&gt;
===Recommendation for artifact template creation===&lt;br /&gt;
For BCG artifact removal we recommend using the PCA based template creation. The ICA approach is a bit difficult for this matter since the BCG artifact is a complex signal distortion (constituted usually from more than three components). Also the main assumption of ICA is violated - components are dependent rather than independent. Keep in mind that the BCG artifact is induced by Hall effect, pulsating skin, and head movement. All of these phenomena are related to the heart beat. On top of that, the part related to movement can consist of up to six components in the worst scenario (head movement and head rotation, both possible in three dimensions). &lt;br /&gt;
===How to create the template===&lt;br /&gt;
&lt;br /&gt;
Before attempting to create the artifact template, it is wise to set a filter to match the artifact frequency. For BCG, the following filter settings should be sufficient:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter &lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Cutoff frequency&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter slope&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter type&lt;br /&gt;
|-&lt;br /&gt;
| Low Cutoff&lt;br /&gt;
| 1&lt;br /&gt;
| zero phase&lt;br /&gt;
| 12 dB/oct&lt;br /&gt;
|-&lt;br /&gt;
| High Cutoff&lt;br /&gt;
| 20&lt;br /&gt;
| zero phase&lt;br /&gt;
| 24 dB/oct&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mark a block of data where BCG is clearly noticeable. You can either use an EKG channel or just all channels as the BCG is very prominent (check the example below). If you decide to use an EKG channel remember that the BCG artifact starts around 200-300 ms after the QRS complex visible in EKG. &lt;br /&gt;
&lt;br /&gt;
[[File:Fmri BCG.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
Go to menu '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Search&amp;lt;/span&amp;gt;''' and verify if '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Search, Average, View&amp;lt;/span&amp;gt;''' option is checked. If not, please enable it. &lt;br /&gt;
&lt;br /&gt;
Press the '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;SAV&amp;lt;/span&amp;gt;''' button in the toolbar to start creation of the artifact template. In the displayed dialog use settings as below to perform searching for artifact occurrences similar to the selected block, using all channels with a criterion for similarity of 65% correlation, after applying predefined filters. When you press OK, the search will start. &lt;br /&gt;
&lt;br /&gt;
[[File:FMRI SaV.PNG]]&lt;br /&gt;
&lt;br /&gt;
When the search is finished you will see the averaged artifact in a buffer on the left side of the data window, as shown below. If you start scrolling through data the averaged block disappear. You can switch it on at any time using the menu entry '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;View/Averaged Buffers&amp;lt;/span&amp;gt;'''. Note that you have blue vertical lines (if you selected to assign the BCG artifacts to pattern 1) in the event bar at the bottom of screen. For good artifact correction they should cover almost the whole file. Also, at the bottom of the averaged buffer display you can see the number of averages (277 for example).  Make sure that this number is relatively large to be sure the artifact template is correctly created.  &lt;br /&gt;
&lt;br /&gt;
[[File:FMRI BCG averaged.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
===How to select the correct number of components for artifact correction===&lt;br /&gt;
Finally click the right mouse button over the averaged buffer and select '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Whole Segment&amp;lt;/span&amp;gt;'''. Click again with the right mouse button over the yellow marked area and select '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Define Artifact Topography&amp;lt;/span&amp;gt;'''. A new dialog will pop up. Check the EKG box and select the number of components used for artifact correction. The component number is followed by a number indicating how much signal variability is explained by the component, expressed in percentage. A question without answer is how many components should be reduced, since it really depends on the data. As a good starting point you may select all components that explain more than 1% of the BCG variance (so basically select the first number with variance lower than 1% - as in the example below 5(0.68)). Note that data will be automatically updated to the current settings. You can adjust this number at any further stage of data processing.&lt;br /&gt;
&lt;br /&gt;
[[File:FMRI components.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Final data processing==&lt;br /&gt;
&lt;br /&gt;
If needed you can also perform blink artifact correction using an approach similar to the EKG reduction (but select only one component at the final stage, since it is a very well-established artifact). &lt;br /&gt;
&lt;br /&gt;
Now you can proceed with further data processing. There are some minor differences in comparison with the general BESA pipeline:&lt;br /&gt;
* if you want to perform averaging you will be similarly asked if you want to turn off artifact correction. Please do so, by pressing '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt;''' button. The artifact correction should be turned on again just after averaging. When the averaged file is open go to menu '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Artifact/Load...&amp;lt;/span&amp;gt;''' and select the file with the exact name of your data file but with extension &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;.atf&amp;lt;/span&amp;gt;. Once the artifact coefficient file is loaded, go to menu '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;Artifact\Options&amp;lt;/span&amp;gt;''' and change the method of brain activity modeling to ''Surrogate''. Please verify if the selected number of artifact components used for reduction can be lowered. &lt;br /&gt;
&lt;br /&gt;
=== Source analysis (requires BESA Research Standard or higher ===&lt;br /&gt;
* As you might have noticed in other tutorials, we generally recommend performing source localization while artifact correction is off, and load artifact coefficients directly to the source analysis module. For EEG-fMRI data however it is acceptable to use artifact corrected data as input to the source analysis module.&lt;br /&gt;
* if you want to perform '''Time-domain beamformer''' accessed from ERP module (average tab) you will be prompted if artifact correction should be turned off. We recommend to perform beamformer with artifact correction off, but for EEG-fMRI data set please keep it on (press '''&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;''' button), since the large BCG artifact will affect results.&lt;br /&gt;
&lt;br /&gt;
==Good practice==&lt;br /&gt;
Please keep in mind that simultaneous EEG-fMRI recording is a difficult yet powerful technique. The following rules could help one to perform a successful experiment:&lt;br /&gt;
* Remember that proper '''EEG and MRI hardware clock synchronization''' is essential for fMRI gradient artifact removal. BESA Research internally performs checks if the synchronization is sufficient however it is the user's responsibility to maintain the hardware configuration. Under any circumstances '''do not change EEG data sampling rate''' prior to the fMRI gradient removal procedure.   &lt;br /&gt;
* For an ERP experiment remember to introduce temporal '''jitter between trials''' (e.g. a random value in the range of ±200 ms). Also, applying a pure EEG or a pure fMRI paradigm will probably have the effect that one of the modalities will not show satisfying results. Proper paradigm preparation is essential for success. Some further guidelines can be found here: (Rusiniak et al., 2013a).&lt;br /&gt;
* Inform your subject how important it is '''not to move'''.&lt;br /&gt;
* Keep electrode to skin '''impedance as low as possible'''.&lt;br /&gt;
* The EEG-fMRI recording session should be long enough to allow for appropriate artifact template creation. Usually the experiment should '''last at least 6 minutes'''.&lt;br /&gt;
* At the same time try to '''limit the time of experiment to a minimum''' and preferably perform EEG-fMRI registration before other sequences to limit movement due to an inconvenient supine position.&lt;br /&gt;
* From the standard position, move the '''subject about 4 cm towards the caudal direction''' to reduce artifacts: The MRI laser crosshair should be not in the Nasion position but in the middle of the forehead (Mullinger et al., 2011).&lt;br /&gt;
* Especially for the first few registrations '''repeat the experiment outside of the MR bore''' to compare results.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* Abreu, R., Leal, A., Figueiredo, P., 2018. EEG-Informed fMRI: A Review of Data Analysis Methods. Front. Hum. Neurosci. 12, 29. https://doi.org/10.3389/fnhum.2018.00029&lt;br /&gt;
* Allen, P.J., Josephs, O., Turner, R., 2000. A Method for Removing Imaging Artifact from Continuous EEG Recorded during Functional MRI. NeuroImage 12, 230–239. https://doi.org/10.1006/nimg.2000.0599&lt;br /&gt;
* Moosmann, M., Schönfelder, V.H., Specht, K., Scheeringa, R., Nordby, H., Hugdahl, K., 2009. Realignment parameter-informed artefact correction for simultaneous EEG–fMRI recordings. NeuroImage 45, 1144–1150. https://doi.org/10.1016/j.neuroimage.2009.01.024&lt;br /&gt;
* Mullinger, K.J., Yan, W.X., Bowtell, R., 2011. Reducing the gradient artefact in simultaneous EEG-fMRI by adjusting the subject’s axial position. NeuroImage 54, 1942–1950.&lt;br /&gt;
* Rusiniak, M., Lewandowska, M., Wolak, T., Pluta, A., Milner, R., Ganc, M., Włodarczyk, A., Senderski, A., Śliwa, L., Skarżyński, H., 2013a. A modified oddball paradigm for investigation of neural correlates of attention: a simultaneous ERP–fMRI study. Magn. Reson. Mater. Phys. Biol. Med. 26, 511–526. https://doi.org/10.1007/s10334-013-0374-7&lt;br /&gt;
* Rusiniak, M., Wolak, T., Lewandowska, M., Cieśla, K., Skarzynski, H., 2013b. The relation between EPI sequence parameters and electroencephalographic data during simultaneus EEG-fMRI registration: an initial report., in: ESMRMB 2013 Congress, Book of Abstracts, Saturday. Presented at the ESMRMB, Springer, Toulouse, p. 661. https://doi.org/10.1007/s10334-013-0384-5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]] [[Category:Preprocessing]] [[Category:Source Analysis]] [[Category: MRI]]&lt;/div&gt;</summary>
		<author><name>Mateusz</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-06T11:35:12Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 6.1 or higher&lt;br /&gt;
}}&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 ''[[Export#Export Dialog|File Export Dialog]]'', a data structure &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt; will be created. After filling the structure, the script &amp;lt;code&amp;gt;besa_action_channels.m&amp;lt;/code&amp;gt; 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 i.e. 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/wp-content/uploads/2021/04/BESA-Research-7.1-Tutorial.pdf 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 [[#Configuration | Configuration]] section! Then read the [[#How the interface works | How the interface works]] section to get started.'''&lt;br /&gt;
&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;
== MATLAB must be installed ==&lt;br /&gt;
&lt;br /&gt;
For the next step (required for MATLAB versions 2009b and over):&lt;br /&gt;
* We need to know whether the '''32-bit''' or '''64-bit''' version of MATLAB is installed.&lt;br /&gt;
* We also need to know the path to the MATLAB installation (e.g. '''C:\Program Files\MATLAB\2009b\''').&lt;br /&gt;
&lt;br /&gt;
== Setting 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: '''C:\Program Files\MATLAB\R2009b\bin\win64'''&lt;br /&gt;
** The path for the 32-bit version: '''C:\Program Files\MATLAB\R2009b\bin\win32'''&lt;br /&gt;
&lt;br /&gt;
* Open the &amp;quot;'''System Properties'''&amp;quot; dialog by holding down the ''&amp;quot;Windows&amp;quot;'' key and pressing the ''&amp;quot;Pause&amp;quot;'' key at the same time (Windows logo key + Pause).&lt;br /&gt;
** In Windows 7, the key combination opens the ''&amp;quot;System Display&amp;quot;''. Click on the link ''&amp;quot;Change Settings&amp;quot;''.&lt;br /&gt;
** In Windows 8 and Windows 10, the key combination also opens the ''&amp;quot;System Display&amp;quot;''. Click on the link &amp;quot;'''Advanced system settings'''&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;
[[Image:Matlab (1) .gif]]&lt;br /&gt;
&lt;br /&gt;
* Select the &amp;quot;'''Advanced'''&amp;quot; tab in the ''&amp;quot;System Properties&amp;quot;'' dialog.&lt;br /&gt;
* Press the &amp;quot;'''Environment Variables...'''&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (2) .gif]]&lt;br /&gt;
&lt;br /&gt;
* Under &amp;quot;'''System variables'''&amp;quot; click on the &amp;quot;'''Path'''&amp;quot; variable, and then click the ''&amp;quot;Edit...&amp;quot;'' button.&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;quot;New&amp;quot;'' button in the resulting dialog and then add the path.&lt;br /&gt;
** Note that if you have multiple versions of MATLAB installed, the added path has to be prior to other MATLAB versions present in the system path.&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (3) .gif]]&lt;br /&gt;
&lt;br /&gt;
[[Image:EditSystemVariable.png]]&lt;br /&gt;
&amp;lt;!-- [[Image:Matlab (4) .gif]] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click ''&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 Vista/7/8/10, you will also need to close the ''&amp;quot;Control Panel&amp;quot;'' window afterwards.&lt;br /&gt;
&lt;br /&gt;
== Additional configuration ==&lt;br /&gt;
&lt;br /&gt;
=== ConfigureBesaMatlabInterface.exe ===&lt;br /&gt;
&lt;br /&gt;
[[File:ConfigureBesaMatlabInterface_01.png|250px]]&lt;br /&gt;
&lt;br /&gt;
(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;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;ConfigureBesaMatlabInterface.exe&amp;lt;/span&amp;gt; (or SetupBesaMatlabInterface.exe) in the BESA Research root folder (e.g.: '''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 dropdown 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 performs two operations:&lt;br /&gt;
* It copies the appropriate interface dll file 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;
* If you are using a 64-bit version, it creates an entry in [[The Initialization File: BESA.ini|BESA.ini]] (e.g.: '''C:\Users\Public\Documents\BESA\Research_7_1''') as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
[Matlab] &lt;br /&gt;
Platform=64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BesaMatlab64Interface.exe ===&lt;br /&gt;
&lt;br /&gt;
[[File:BesaMatlab64Interfaces_01.png|200px]]&lt;br /&gt;
&lt;br /&gt;
'''Note: This step is not needed from BESA Research 7.1 March 2021.'''&lt;br /&gt;
&lt;br /&gt;
If the installed MATLAB is 64-bit version, please run the program &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BesaMatlab64Interface.exe&amp;lt;/span&amp;gt; in the BESA Research root folder (e.g.: '''C:\Program Files (x86)\BESA\Research_7_1'''). If the MATLAB path is set properly, a program window as the screenshot below is shown up without an error message. After that please just close the window.&lt;br /&gt;
&lt;br /&gt;
[[File:BesaMatlab64Interfaces_02.png|400px]]&lt;br /&gt;
&lt;br /&gt;
== 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 in the &amp;quot;'''Path'''&amp;quot; environment variable the path to the current MATLAB version exist and, in case of other MATLAB version are present, is first on a list.&lt;br /&gt;
# Make sure that the correct MATLAB interface dll (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BesaMatlab.dll&amp;lt;/span&amp;gt; (32-bit version) or &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;BesaMatlab64.dll&amp;lt;/span&amp;gt; (64-bit version)) is installed by starting the tool &amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;ConfigureBesaMatlabInterface.exe&amp;lt;/span&amp;gt; (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 &amp;lt;source lang=&amp;quot;dos&amp;quot;&amp;gt;matlab -regserver&amp;lt;/source&amp;gt; ([https://www.mathworks.com/help/matlab/matlab_external/register-matlab-as-automation-server.html registers MATLAB as a Component Object Model (COM) server]).&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;
#* Alternatively, you can also run the attached [ftp://h1772544.stratoserver.net/public/Matlab/BESA_Utilities/UserRegMATLAB.p UserRegMATLAB.p] function to manually register your MATLAB version as a COM Automation Server. To switch the version of MATLAB that is registered, simply run the &amp;lt;code&amp;gt;UserRegMATLAB&amp;lt;/code&amp;gt; command on the new version so that it becomes the new COM Automation Server.&lt;br /&gt;
#* Finally, since MATLAB 2020a to register COM server a following command can be executed directly form MATLAB: &amp;lt;code&amp;gt;comserver('register')&amp;lt;/code&amp;gt;. This does not require administrator account&lt;br /&gt;
# Run '''CMD (Command Prompt) as NOT administrator''', and then execute the following command &amp;lt;source lang=&amp;quot;dos&amp;quot;&amp;gt;matlab -automation&amp;lt;/source&amp;gt; ([https://www.mathworks.com/help/matlab/matlab_external/creating-the-server-manually.html Manually create automation server]: start MATLAB as a Component Object Model (COM) Automation server. MATLAB does not display the splash screen).&lt;br /&gt;
#* Close the CMD and MATLAB Command Window (there should be no error message).&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Start BESA Research and check if '''Send to MATLAB...''' is displayed in the '''File''' 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 MATLAB interface&lt;br /&gt;
* Open a data file, mark a short (e.g. 1 s) time range, and select '''File / Send to MATLAB...''' to open  the ''[[Export#Export Dialog|Export Dialog]]''.&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab1.png]]&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;
[[Image:Matlab (6) .gif]]&lt;br /&gt;
&lt;br /&gt;
* After the window closes, open the MATLAB window, and type '''&amp;lt;code&amp;gt;workspace&amp;lt;/code&amp;gt;''' to open the workspace window, or '''&amp;lt;code&amp;gt;desktop&amp;lt;/code&amp;gt;''' to open the standard MATLAB desktop.&lt;br /&gt;
* Examine the &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt; variable, which contains the data for the marked data segment.&lt;br /&gt;
&lt;br /&gt;
[[Image:Matlab (7) .gif]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&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:SendToMatlab.png|thumb|400px|Figure 4. Send marked segment to MATLAB]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:SendToMatlabProgressbar.png|thumb|200px|Figure 5. Send to MATLAB progress bar]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:ExportedMatlabStructure.png|thumb|300px|Figure 6. Data exported from BESA Research to MATLAB]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
--&amp;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 (the above step for Setting PATH environment variable) 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;
&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;
Some additional scripts are used for specific data types. For example, when exporting raw data, two scripts, ''besa_helper_channels_event.m'' (or ''besa_helper_channels_event_continousdata.m'' for 64bit) 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 10 typically ''C:\Users\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>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=How_to_Prepare_Data_for_BESA_Connectivity</id>
		<title>How to Prepare Data for BESA Connectivity</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=How_to_Prepare_Data_for_BESA_Connectivity"/>
				<updated>2021-05-05T19:48:08Z</updated>
		
		<summary type="html">&lt;p&gt;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&amp;lt;br/&amp;gt;BESA Connectivity&lt;br /&gt;
|version = BESA Research 7.0 or higher&amp;lt;br/&amp;gt;BESA Connectivity 1.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Note and general remarks==&lt;br /&gt;
This article applies to data that are prepared using BESA Research. It is also possible to read data prepared by other programs. For the requirements, please refer to the BESA Connectivity manual, the chapter on &amp;quot;Loading data that were created in other software&amp;quot; and the chapter &amp;quot;File formats&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BESA Connectivity needs the following data:&lt;br /&gt;
# A file containing the binary data matrix. All epochs in the data file need to have the same length, the same stimulus position, the same baseline interval, and the same channel configuration.&lt;br /&gt;
# A header file in ASCII format.&lt;br /&gt;
# A channel description file in ASCII format. Two types of files are supported: [[#ELP file format|elp]] files and [[BSA file format|bsa]] files.&lt;br /&gt;
&lt;br /&gt;
== File format descriptions ==&lt;br /&gt;
&lt;br /&gt;
=== Header file format ===&lt;br /&gt;
The header file is a standard ASCII file. It contains the following lines:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Line&lt;br /&gt;
! Entry&lt;br /&gt;
! Possible values&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| BESA Generic Data v1.1&lt;br /&gt;
| &lt;br /&gt;
| File format version&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| nChannels=&lt;br /&gt;
| [1 ... 1024]&lt;br /&gt;
| Number of channels.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| sRate=&lt;br /&gt;
| [0.0001 ... ]&lt;br /&gt;
| Sampling rate (samples/second) in Hz.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| nSamples=&lt;br /&gt;
| [1 ...]&lt;br /&gt;
| Total number of samples in file.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| format=&lt;br /&gt;
| float&lt;br /&gt;
| Format of the data in the binary file.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| file=&lt;br /&gt;
| Name of binary file.&lt;br /&gt;
| Name of binary file without path information.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| prestimulus=&lt;br /&gt;
| 500.000&lt;br /&gt;
| Pre-stimulus interval in milliseconds. If negative, then the epoch starts after the stimulus. This effectively means that the value of prestimulus denotes the  position of the stimulus in the epoch (milliseconds after epoch start).&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| epochs=&lt;br /&gt;
| &lt;br /&gt;
| Number of epochs in the data file.&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| baselineStart=&lt;br /&gt;
| &lt;br /&gt;
| Baseline start relative to the stimulus position. The value should be given in milliseconds.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| baselineEnd=&lt;br /&gt;
| &lt;br /&gt;
| Baseline end relative to the stimulus position. Must be &amp;gt;= baselineStart. The value should be given in milliseconds.&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| epochLength=&lt;br /&gt;
| &lt;br /&gt;
| Epoch length in milliseconds. This parameter is optional and can be added for convenience. If not given, the epoch length is calculated from the overall number of samples, the sampling rate, and the number of epochs.&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Padding=&lt;br /&gt;
| 2000.000&lt;br /&gt;
| Information concerning extra data values that surround the epoch to provide padding for wavelets, expressed in milliseconds. If exported from BESA Research the default value is 2000ms.&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| conditionName=&lt;br /&gt;
| &lt;br /&gt;
| Name of the condition that identifies it.&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| channelUnits=&lt;br /&gt;
| &lt;br /&gt;
| Unit that the data are stored in the binary file. For EEG data, it should be one of µV, mV, V, µV/cm². For source data, it should be one of nAm, nAm/cm², nAm/cm³. For MEG data, it should be one of fT, pT, fT/cm, pT/cm, µV/cm².&lt;br /&gt;
This entry is repeated &amp;lt;nChannels&amp;gt; times.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Channel configuration file format ===&lt;br /&gt;
&lt;br /&gt;
The channel description file is an ASCII file. Two types of files are supported: .elp files and .bsa files.&lt;br /&gt;
&lt;br /&gt;
==== ELP file format ====&lt;br /&gt;
&lt;br /&gt;
Elp files describe surface channel coordinates using spherical coordinates (theta, phi). It contains one line for each channel in the data file. Each line contains the following entries:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Column&lt;br /&gt;
! Entry&lt;br /&gt;
! Possible values&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Channel type&lt;br /&gt;
| EEG (scalp electrode)&amp;lt;br&amp;gt;&lt;br /&gt;
SCP (scalp electrode)&amp;lt;br&amp;gt;&lt;br /&gt;
POL (polygraphic channel)&amp;lt;br&amp;gt;&lt;br /&gt;
PGR (polygraphic channel)&amp;lt;br&amp;gt;&lt;br /&gt;
ICR (intracranial electrode)&amp;lt;br&amp;gt;&lt;br /&gt;
MEG (MEG sensor)&amp;lt;br&amp;gt;&lt;br /&gt;
REF (reference electrode)&lt;br /&gt;
| This column denotes the type of the channel.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Channel label&lt;br /&gt;
| Fpz&amp;lt;br&amp;gt;&lt;br /&gt;
Fz&amp;lt;br&amp;gt;&lt;br /&gt;
Fpz'&amp;lt;br&amp;gt;&lt;br /&gt;
EOG&amp;lt;br&amp;gt;&lt;br /&gt;
TpL_r, ...&lt;br /&gt;
| Channel label. Is not allowed to contain blanks.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Azimuth (theta)&lt;br /&gt;
| [-180.00 ... 180.00]&lt;br /&gt;
| Spherical azimuth angle in degrees (optional entry).&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Latitude (phi)&lt;br /&gt;
| [-90.00 ... 90.00]&lt;br /&gt;
| Spherical latitude angle in degrees (optional entry).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== BSA file format ====&lt;br /&gt;
&lt;br /&gt;
Bsa files describe source channel data. They have a header section for format version and readability, followed by one line for each source channel.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Column&lt;br /&gt;
! Entry&lt;br /&gt;
! Possible values&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Channel type&lt;br /&gt;
| RegSrc (regional source)&lt;br /&gt;
DipSrc (dipole)&amp;lt;br&amp;gt;&lt;br /&gt;
SptCmp (spatial component)&amp;lt;br&amp;gt;&lt;br /&gt;
| This column denotes the type of the channel.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| x location&lt;br /&gt;
| &lt;br /&gt;
| x coordinate of the channel.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| y  location&lt;br /&gt;
| &lt;br /&gt;
| y coordinate of the channel.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| z location&lt;br /&gt;
| &lt;br /&gt;
| z coordinate of the channel.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| x orientation&lt;br /&gt;
| &lt;br /&gt;
| x orientation of the channel.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| y orientation&lt;br /&gt;
| &lt;br /&gt;
| y orientation of the channel.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| z orientation&lt;br /&gt;
| &lt;br /&gt;
| z orientation of the channel.&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Color&lt;br /&gt;
| [0 … 255*255*255]&lt;br /&gt;
| RGB color value&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The coordinate system is defined by a sphere with unit dimensions, which is fitted to the coordinates of sensors on the head. In the absence of [[Integration with MRI and fMRI|co-registration]] information with individual MRI data, the axes are defined by reference points on the head known as fiducials. The reference points are normally the nasion (NAS), the left preauricular point (LPA), and the right preauricular point (RPA). The direction of the x axis is defined by the line joining LPA and RPA, positive towards RPA. The direction of the y axis is defined by the line through NAS that is perpendicular to the x axis (positive towards NAS). The z axis is perpendicular to the x and y axes, and goes up out of the upper part of the head (e.g. Cz). On average, the center of the unit sphere is about 4 cm above the origin of the head coordinate system.&lt;br /&gt;
&lt;br /&gt;
=== Binary data matrix file format ===&lt;br /&gt;
&lt;br /&gt;
The binary data matrix is saved in float format and contains ''&amp;lt;Number of epochs&amp;gt; * &amp;lt;Number of samples per epoch&amp;gt; * &amp;lt;Number of channels&amp;gt;'' values. These are stored in the following order:&lt;br /&gt;
*Slowest index: epochs&lt;br /&gt;
*Next index: samples&lt;br /&gt;
*Fastest index: channels&lt;br /&gt;
This is the so-called multiplexed file format. The default extension for this header file is: ''*.dat''&lt;br /&gt;
&lt;br /&gt;
== Export data using BESA Research ==&lt;br /&gt;
&lt;br /&gt;
Please follow the steps in the BESA Research 7.1 tutorial, chapter 12 - Time-frequency Analysis, Connectivity Analysis and Beamforming: [https://www.besa.de/wp-content/uploads/2021/04/BESA-Research-7.1-Tutorial.pdf Link]&lt;br /&gt;
&lt;br /&gt;
== Batch export data using BESA Research ==&lt;br /&gt;
''(requires BESA Researh version 7.1)''&lt;br /&gt;
&lt;br /&gt;
BESA Research provides batch processing multiple files to export data for BESA Connectivity. This will simplify and speed up your analysis if you need to apply the same data preparation steps for a large number of files.&lt;br /&gt;
&lt;br /&gt;
This section will provide the batch that is required to export the data epochs and will also explain additional steps that need to be performed to load the exported data sets into BESA Connectivity.&lt;br /&gt;
&lt;br /&gt;
==== BESA Research Batch ====&lt;br /&gt;
&lt;br /&gt;
The batch commands required to export all epochs around trigger #1 is displayed below. The first step is to set the specific montage in which all epochs should be exported. Then, the default epoch length needs to be set. In this example, epochs range from -500ms to 2000ms. However, preceding and succeeding padding intervals of 2000ms are required to avoid edge effects during time-frequency transformation. Therefore, the resulting default epoch is set to -2500ms to 4000ms. After this, trigger #1 is selected and epochs are exported to ''C:\Users\&amp;lt;USERNAME&amp;gt;\Documents\BESA\Research_7_1\Export\Batch Export\''. Finally, the batch will also export the channel configuration file (*.elp) in case of sensor data. In case of source data, the corresponding source configuration file (*.bsa) that was used to create the respective source montage needs to be copied to the output folder manually!&lt;br /&gt;
&lt;br /&gt;
Please note: adjust the ''&amp;lt;USERNAME&amp;gt;'' placeholder or the export path according to your needs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
; Set montage&lt;br /&gt;
MAINMontage(DMN with Noise Sources, Wait if invalid, GlobalMontage)&lt;br /&gt;
; Set epoch length. Note: add 2000ms padding ad start &amp;amp; end&lt;br /&gt;
EditDefaultEpoch(-2500.000,4000.000)&lt;br /&gt;
;&lt;br /&gt;
; Export epochs for trigger #1&lt;br /&gt;
TriggerSelect(1)&lt;br /&gt;
MAINExport(%basename%-export-T1, C:\Users\&amp;lt;USERNAME&amp;gt;\Documents\BESA\Research_7_1\Export\Batch Export\, Epochs, SimpleBin, Current, FiltOff, NoResample, Replace, -, , WholeFile)&lt;br /&gt;
;&lt;br /&gt;
; Export channel configuration file&lt;br /&gt;
MAINMarkBlock(Rawdata,-,1)&lt;br /&gt;
MAINExport(%basename%-export-T1, C:\Users\&amp;lt;USERNAME&amp;gt;\Documents\BESA\Research_7_1\Export\Batch Export\, Segment, ASCmul, Original, FiltOff, NoResample, Replace, -, , WholeFile)&lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
This batch can be downloaded from the following link and loaded in the ''Batch'' tab of the ''Batch Processing'' module:[[Media:Batch_Export_for_BESA_Connectivity.bbat|Download link.]]&lt;br /&gt;
&lt;br /&gt;
==== Additional Steps ====&lt;br /&gt;
&lt;br /&gt;
In order to be able to import the saved data sets into BESA Connectivity, there are a few changes that need to be made to the exported *.generic file(s).&lt;br /&gt;
&lt;br /&gt;
When opening the *.generic file with a text editor you will realize that the format slightly differs from the file format description above. the following images compare the exported file (left) and the adjusted file that can be imported into BESA Connectivity (right).  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;p&amp;gt;[[File:Generic_File_Unchanged.png|150px|top]][[File:Generic File Modified.png|150px|alt text]]&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please adjust or add the following sections to the *.generic file:&lt;br /&gt;
* File format version: set to V1.1&lt;br /&gt;
* Add lines for baselineStart, baselineEnd and epochLength. Note: the time stamps do not include the padding intervals!&lt;br /&gt;
* Add the line to specify the padding interval of 2000ms.&lt;br /&gt;
* Add the specification of the condition name. &lt;br /&gt;
* Add one line per channel/source and specify the its label and unit. &lt;br /&gt;
&lt;br /&gt;
Save the file after performing the changes. &lt;br /&gt;
&lt;br /&gt;
If you are working with source data, make sure that the corresponding source configuration file (*.bsa) has the same basename as the *.generic file. Otherwise, BESA Connectivity will not be able to load the file.&lt;br /&gt;
&lt;br /&gt;
Now the exported data sets are ready to be loaded into BESA Connectivity!&lt;br /&gt;
&lt;br /&gt;
== Export data using Matlab ==&lt;br /&gt;
&lt;br /&gt;
We provide several Matlab routines for exporting the required data files from Matlab to BESA Connectivity. The scripts can be downloaded from the following website: [http://www.besa.de/downloads/matlab/ MATLAB Scripts].&lt;br /&gt;
&lt;br /&gt;
The ''Matlab_to_BESAConnectivity.m'' script (download available here: [https://www.besa.de/wp-content/uploads/2020/10/BESAConnectivityScripts.zip BESA Connectivity Scripts]) can be used as an example to generate and export data from MATLAB to BESA Connectivity.&lt;br /&gt;
It shows how to define required parameters, generates example sine waves and calls the export function ''besa_save2Connectivity'' (included in: [https://www.besa.de/wp-content/uploads/2020/10/MATLAB2BESA.zip MATLAB to BESA Export functions]) to store the simulated example data to disc. It will store the file containing the binary data matrix, as well as the header file and channel description file in ASCII format.&lt;br /&gt;
&lt;br /&gt;
The script can be easily adopted to export your trial data do BESA Connectivity for time-frequency and connectivity analysis!&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Minimal examples for data files that can be imported in BESA Connectivity can be downloaded here.&lt;br /&gt;
# EEG data: this data set contains 25 trials (trial length: -400ms to 1200ms) of scalp data with 27 electrodes at a sampling rate of 320 samples/second.&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;p&amp;gt;[[Media:BESA_Connectivity_EEG_data.zip|Download link.]]&amp;lt;/p&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;p&amp;gt;[[File:BESA_Connectivity_Set_Parameters_EEG_Data.png|400px]][[File:BESA_Connectivity_Run_Analysis_EEG_Data_iCoh.png|400px|alt text]]&amp;lt;/p&amp;gt;&lt;br /&gt;
# Source data: this data set contains 33 trials (trial length: -400ms to 1200ms) of source data with 19 dipoles at a sampling rate of 320 samples/second.&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;p&amp;gt;[[Media:BESA_Connectivity_Source_data.zip|Download link.]]&amp;lt;/p&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;p&amp;gt;[[File:BESA_Connectivity_Set_Parameters_Source_Data.png|400px]][[File:BESA_Connectivity_Run_Analysis_Source_Data_iCoh.png|400px|alt text]]&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Connectivity]] [[Category:Time-Frequency]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Inserting_Triggers_Relative_to_Existing_Events</id>
		<title>Inserting Triggers Relative to Existing Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Inserting_Triggers_Relative_to_Existing_Events"/>
				<updated>2021-05-05T19:31:09Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Say you are interested in studying neural activity that precedes an existing trigger. This can be addressed in the following ways:&lt;br /&gt;
&lt;br /&gt;
# You are interested in a certain epoch that precedes the trigger event that is already coded. So, instead of entering a new trigger code, you could just add a new condition that works on the existing trigger code, and merely changes the epoch of interest. Presumably you have defined a condition where you are looking at the activity around the trigger event: some baseline before and then the activity that follows the trigger. Now, you can use the ERP-&amp;gt; Edit Paradigm to insert a new condition (CURRENT.code IS ... ). Then click on the “Epoch” tab and modify the epoch of this new condition – e.g. -1000 ms...-200 ms, also change the baseline epoch accordingly, then highlight the new condition in the list, and assign the epoch to the new condition. This condition will now average over the defined epoch that precedes the trigger.&lt;br /&gt;
#If you really need a new trigger code, you can export the trigger codes as [[Event File Format|event file]], using the menu ERP-&amp;gt;Save Events As...  This will save events as a text file. Then open this “*.evt” file in a text editor or e.g. in Excel. The file lists the elapsed time in microseconds, and the event type. Now, for all event types that you want to replace, subtract 1000000 from the number in the first column. Change the code of the trigger to a new value, e.g. 511. Remove the events that you don’t want to change. Save this file under a different name in text format, and open it again in BESA using ERP-&amp;gt;Open Event File... (For example, you can use Excel in the following way: Open the file. Select all columns, and sort by the “Comnt” column. Delete all rows that contain trigger events that you don’t want to change. In cell E2, type the formula “=A2-1000000” and apply to all rows. Then copy this and paste values back into the A column. Delete column E. Change column C values (TriNo). Then save as text file, and re-load in BESA.)&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]]&lt;/div&gt;</summary>
		<author><name>Mateusz</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-05T19:17:33Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 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 ''[[Export#Export Dialog|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 i.e. 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/wp-content/uploads/2021/04/BESA-Research-7.1-Tutorial.pdf 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;
'''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;
* Note that if you have multiple versions of MATLAB installed, the added path has to be prior to other MATLAB versions present in the system path.&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;
** alternatively since MATLAB 2020a to register COM server a following command can be executed  directly form MATLAB: &amp;lt;code&amp;gt; comserver('register')&amp;lt;/code&amp;gt;. This does not require administrator account.&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#Export Dialog|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'' (or ''besa_helper_channels_event_continousdata.m'' for 64bit) 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 10 typically ''C:\Users\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>Mateusz</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-05T18:51:32Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 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>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export_each_gradiometer_and_magnetometer_data_separately</id>
		<title>Export each gradiometer and magnetometer data separately</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export_each_gradiometer_and_magnetometer_data_separately"/>
				<updated>2021-05-05T15:02:21Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Research Basic MEG or higher&lt;br /&gt;
|version = 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
In order to export each gradiometer and magnetometer data separately, a montage for each MEG sensor type should be applied before exporting data using the Export dialog.&lt;br /&gt;
&lt;br /&gt;
== Create a montage ==&lt;br /&gt;
&lt;br /&gt;
Below is an example to create a montage for gradiometer channels.&lt;br /&gt;
&lt;br /&gt;
# Open a MEG data in BESA Research&lt;br /&gt;
# Select the menu entry &amp;quot;'''Edit / Montages ...'''&amp;quot; (or press the &amp;quot;'''EdM'''&amp;quot; button in the ribbon menu)&lt;br /&gt;
# Delete the montage channels of magnetometer and other unnecessary channels in the Montag Editor window&lt;br /&gt;
#* [[FILE:ME_deleteSelectedCh.png|800px]]&lt;br /&gt;
# Save the montage using the menu entry &amp;quot;'''File / Save Montage As...'''&amp;quot;&lt;br /&gt;
#* The saved montage file can be used later.&lt;br /&gt;
# Set the created montage by selecting the menu entry &amp;quot;'''File / Exit and Set Montage'''&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Export data ==&lt;br /&gt;
&lt;br /&gt;
# Check the current montage in the review window of BESA research&lt;br /&gt;
#* If the current montage is not the created one in the above step, press &amp;quot;'''Usr'''&amp;quot; button in the ribbon menu and choose the saved montage.&lt;br /&gt;
# Export gradiometer data using the [[Export#Export Dialog|export dialog]] ('''File / Export data''') with the options below:&lt;br /&gt;
#* Data to export: '''Contigous data'''&lt;br /&gt;
#* Montage and Filters: '''Current montage'''&lt;br /&gt;
#* Target data formats: '''BESA binary'''&lt;br /&gt;
&lt;br /&gt;
[[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export</id>
		<title>Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export"/>
				<updated>2021-05-05T14:59:57Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Exporting files from BESA ==&lt;br /&gt;
&lt;br /&gt;
Data can be exported from BESA Research in the following formats:&lt;br /&gt;
* BESA's own binary format (compressed or uncompressed)&lt;br /&gt;
* ASCII multiplexed&lt;br /&gt;
* ASCII vectorized (short files only)&lt;br /&gt;
* EDF+&lt;br /&gt;
* Simple floating point matrix (e.g. for exporting data to Matlab)&lt;br /&gt;
* Send the data directly to Matlab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can export&lt;br /&gt;
* The entire data set or between markers&lt;br /&gt;
* The currently marked segment&lt;br /&gt;
* [[Export Single Trial Data|Epochs around triggers]]&lt;br /&gt;
* Standard deviations from binary average files (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''*.fsg'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Export is allowed to various montages:&lt;br /&gt;
* filtered or unfiltered data&lt;br /&gt;
* original data&lt;br /&gt;
* current montage (including artifact correction if applied)&lt;br /&gt;
* standard 81-electrode montage.&lt;br /&gt;
&lt;br /&gt;
On export, you can choose to change the sampling rate.&lt;br /&gt;
&lt;br /&gt;
If exporting to BESA's binary format, you can optionally append the data to a preexisting data set, if sampling rates and the number of channels match. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start export you have to:&lt;br /&gt;
* select File / Export...&lt;br /&gt;
* press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS '''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
* for Send to Matlab only: select File / Send To MATLAB... This also opens the Export Dialog, but only the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Send To Matlab radio'''&amp;lt;/span&amp;gt; button is enabled as target format in the dialog.&lt;br /&gt;
&lt;br /&gt;
== Export Dialog ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The dialog is started when you select'' File / Export...'' or press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS'''&amp;lt;/span&amp;gt; button or select '''Write Segment''' in the right click context menu when a segment has been highlighted.&lt;br /&gt;
&lt;br /&gt;
The dialog is divided into four sections:&lt;br /&gt;
* ''Data to export''. Describes which data are to be exported.&lt;br /&gt;
* ''Montage and Filters.'' Which montage is to be exported, and whether or not filters are used.&lt;br /&gt;
* ''Target data formats''. Specify the format of the exported data.&lt;br /&gt;
* ''Resampling.'' Specify a new sampling rate in the exported data.&lt;br /&gt;
&lt;br /&gt;
''Anonymize using target file name'': Export can be performed either with or without anonymizing using the checkbox &amp;quot;Anonymize using target file name&amp;quot;. When the checkbox is checked, the subject name is replaced by a target file name, and the subject birth date is replaced by 1st July of the subject birth year.&lt;br /&gt;
&lt;br /&gt;
== Type of data to export ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (2).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The types of data to export are:&lt;br /&gt;
* '''Continuous data'''. The whole data set or the data between markers are exported.&lt;br /&gt;
* '''Marked segment.''' If a segment of data is highlighted, this radio button is enabled. Select Marked segment to export just this segment.&lt;br /&gt;
* '''Epochs around triggers.''' Export data segments around triggers. If this item is selected, the two buttons &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Interval'''&amp;lt;/span&amp;gt;... and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Triggers'''&amp;lt;/span&amp;gt;... are enabled. They allow to select the interval (cf ''Edit / Default'' ''Block Epoch''...), and choose among the available triggers (see ''Edit / Trigger Values''...). Note that the default block epoch values are persistent across BESA Research sessions. The trigger selection is not persistent! You can read more about this option here: [[Export Single Trial Data]]&lt;br /&gt;
* '''Standard Deviations (from fsg file only).''' If the average file was generated using the BESA Research ERP module, standard deviations are saved in the file. Check this item to export these values to an ASCII file.&lt;br /&gt;
&lt;br /&gt;
'''Between markers.''' If there are markers in the file, and '''Marked segment''' is not selected, selecting '''Between markers''' will result in the export of data between markers relative to the current position in the file (as defined by the middle of the current display), either:&lt;br /&gt;
* if there is no previous marker, from the beginning of the file to the next marker, or&lt;br /&gt;
* from the previous to the next marker, or&lt;br /&gt;
* if there is no next marker, from the previous marker to the end of the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Montages and Filters ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The data can be exported either&lt;br /&gt;
&lt;br /&gt;
* '''Original data.''' The data are exported using the original montage&lt;br /&gt;
&lt;br /&gt;
* '''Current montage.''' The currently selected montage is exported. If extra channels, e.g. selected channels or artifact waveforms are displayed, these are exported as well. Notes:&lt;br /&gt;
** When 'Current Montage' is selected, no auxiliary files are exported. When re-importing the data into BESA Research, all channels will be defined as polygraphic.&lt;br /&gt;
** If the current data is artifact-corrected, the artifact-corrected data will be exported when 'Current Montage' is selected.&lt;br /&gt;
&lt;br /&gt;
* '''Standard 81 electrode locations.''' EEG data are interpolated to a set of 81 electrodes on a standard head (average over 24 mainly Caucasian heads).&lt;br /&gt;
&lt;br /&gt;
* Export can be performed either with or without the currently selected filters. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Filters'''&amp;lt;/span&amp;gt;... button to change the current filter settings (see also ''Filters / Edit Filter Settings''...). Note that if artifact correction was performed and this checkbox is enabled, data will be exported with artifact correction. &lt;br /&gt;
&lt;br /&gt;
== Target Data Formats ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (4).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following target formats are available:&lt;br /&gt;
&lt;br /&gt;
* '''BESA binary''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt;&amp;quot; or &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.fsg'''&amp;lt;/span&amp;gt;&amp;quot;. You can select whether to export with no compression (recommended for averages), or compressed (recommended for raw data). Note that compression can result in loss of resolution in averaged data. See [[Export#Data_Compression|Data Compression]].&lt;br /&gt;
&lt;br /&gt;
* '''ASCII multiplexed''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Multiplexed_file_format|ASCII multiplexed format]] for a description of the data format. If the type of data to export is '''Epochs''' '''around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
* '''ASCII vectorized''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.avr'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Vectorized_file_format|ASCII vectorized format]] for a description of the data format. If the type of data to export is '''Epochs around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc. The data are not average referenced before saving. They will only be average referenced if the data are exported using an average referenced '''Current montage'''. You are only allowed to export small segments in vectorized format. If you have selected '''Continuous data''', this item will be disabled if the data are longer than 20 s in duration.&lt;br /&gt;
&lt;br /&gt;
* '''European Data Format (EDF+)''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.edf'''&amp;lt;/span&amp;gt;&amp;quot;. Export of '''Epochs around triggers''' to EDF+ is currently not possible.&lt;br /&gt;
&lt;br /&gt;
* '''Simple binary matrix''': Data are written to a floating point binary matrix with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.dat'''&amp;lt;/span&amp;gt;&amp;quot;. The matrix has the dimension no of samples x no of channels. In addition, a header file with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.generic'''&amp;lt;/span&amp;gt;&amp;quot; is also written. The header file is a text file contains information about the number of channels, sampling rate, and number of samples. These follow the specifications of the Generic File Format. This data format can be useful as a means of transferring data to other programs (e.g. '''MATLAB''') in a relatively compact form. If the type of data to export is '''Epochs around triggers''', the epochs are concatenated in the same target file. In this case, the header file contains a line specifying the number of epochs (cf. ''Generic File Format''). The number of samples in each epoch is the total number of samples, divided by the number of epochs.&lt;br /&gt;
&lt;br /&gt;
* '''Send To MATLAB''': The data are exported directly to MATLAB into the struct variable &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt;. For more information on the data transfer from BESA Research to MATLAB, please refer to the Help chapter [[MATLAB_Interface | MATLAB interface]].&lt;br /&gt;
&lt;br /&gt;
== Resampling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check '''Resample data''' to change the sampling rate of the target data. The edit box is enabled, and you specify a sampling rate.&lt;br /&gt;
&lt;br /&gt;
Data are resampled using splines. Thus, the new sampling rate is not limited to fractions or multiples of the original rate.&lt;br /&gt;
&lt;br /&gt;
Note that if '''Resample data''' is not checked, the sampling rate of the source data is displayed.&lt;br /&gt;
&lt;br /&gt;
'''Resampling and aliasing'''. If you want to reduce the sampling rate it is important to avoid aliasing! It is recommended that a low-pass filter with a boundary frequency of not more than 1/3 of the original sampling rate is used. When you set a new sampling rate, BESA Research checks the current filter settings. If export without filters is selected, or if the current low-pass filter is set to a value that is higher than 1/3 of the sampling rate, BESA Research sets the filter, and opens a message box with a warning:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You may adjust the filters by pressing the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Filter'''&amp;lt;/span&amp;gt; button, e.g. if the original data were already recorded with a sufficiently low low-pass filter setting, so that additional filtering is unnecessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Compression ==&lt;br /&gt;
&lt;br /&gt;
When exporting to BESA binary format and ASCII multiplex formats, you can compress the data to save space. Here we describe properties and pitfalls of the compression algorithm.&lt;br /&gt;
&lt;br /&gt;
=== Compression of BESA binary data ===&lt;br /&gt;
&lt;br /&gt;
'''How compression works'''&lt;br /&gt;
&lt;br /&gt;
The compression algorithm works on two principals:&lt;br /&gt;
* '''Data resolution can often be reduced without losing data quality.''' For instance, a data resolution of 0.1 µV or higher is unnecessary for viewing normal EEG -- 0.5 µV or 1 µV steps are sufficient. Similarly for event-related potentials: the raw data only require a resolution of 0.5 µV or 1 µV to achieve a much higher resolution after averaging.&lt;br /&gt;
* '''Differences between successive data samples''' on a signal are generally much smaller than '''the absolute values of the data'''. Thus, one start value, and then a series of subsequent differences can be stored in a much smaller space than an equivalent series of absolute values. A consequence of this principle is that smoothed signals (with high frequencies removed) can be compressed into a smaller space than signals with a lot of high frequency noise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Compression parameter'''&lt;br /&gt;
&lt;br /&gt;
The parameter you need to choose is the data resolution, or step size. Steps smaller than this size will no longer be represented in the compressed data. The BESA Research Export Module allows the following steps for the compression of EEG signals:&lt;br /&gt;
&lt;br /&gt;
0.1 µV, 0.2 µV, 0.5 µV, 1 µV&lt;br /&gt;
&lt;br /&gt;
For raw EEG data, we recommend using a step size of 0.5 µV.&lt;br /&gt;
&lt;br /&gt;
'''Different compression parameters for different data types (pitfalls!)'''&lt;br /&gt;
&lt;br /&gt;
As described above, the step sizes make sense for EEG signals. For other types of data, other step sizes make more sense. In addition, a polygraphic signal can have the same order of signal magnitude as the EEG (e.g. an EOG or EKG signal), but it might have a completely different scale, e.g. a voice signal, recorded in mV or V. To help accommodate different orders of signal magnitude, BESA Research applies the following rules:&lt;br /&gt;
* '''MEG data:''' Step sizes (in units of fT) are 20 x the step size in µV. Thus, a step size of 0.5 µV will lead to a step size of 10 fT for MEG data.&lt;br /&gt;
* '''Polygraphic and ICR data''': The step size depends on the current amplitude scaling factor in BESA Research. A multiplication factor is used that is the current scaling factor, divided by 100. Thus, if the scale is set to 1 V, the factor is 10 mV. If you have chosen an EEG step size of 0.5 µV, the resulting step size will be 10 x 0.5 = 5 mV.&lt;br /&gt;
&lt;br /&gt;
A pitfall in compression is that if the current amplitude scaling for polygraphic or ICR data does not display the signal sensibly, compression may lead to complete loss of the signal. Note that this only applies to polygraphic and ICR channel types.&lt;br /&gt;
&lt;br /&gt;
* '''Averages:''' We recommend that averaged ERPs are not compressed. Since the signals are generally much smaller than the raw data, compression will lead to unacceptable loss of data resolution.&lt;br /&gt;
&lt;br /&gt;
=== Compression of ASCII multiplexed data ===&lt;br /&gt;
&lt;br /&gt;
When compression is specified, data are written as integer values, and the scaling is specified in the header line of the *.mul file as ''Bins/uV=xxx''. &lt;br /&gt;
&lt;br /&gt;
With no compression, the header contains ''Bins/uV=1.0'', and the data are written with 7 characters per number (e.g. -4.5084, 2.57239).&lt;br /&gt;
&lt;br /&gt;
With compression, the data are written as integers, e.g. 0 -10 -6 -4, which can lead to considerably less characters and thus&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! No compression&lt;br /&gt;
! 0.1&lt;br /&gt;
! 0.2&lt;br /&gt;
! 0.5&lt;br /&gt;
! 1.0&lt;br /&gt;
|-&lt;br /&gt;
| -4.5084&lt;br /&gt;
| -4.5 (-45)&lt;br /&gt;
| -4.6 (-23)&lt;br /&gt;
| -4.5 (-9)&lt;br /&gt;
| -5.0 (-5)&lt;br /&gt;
|-&lt;br /&gt;
| 2.57239&lt;br /&gt;
| 2.6 (26)&lt;br /&gt;
| 2.6 (13)&lt;br /&gt;
| 2.5 (5)&lt;br /&gt;
| 3.0 (3)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The numbers in brackets are the values written to the data file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export_Single_Trial_Data</id>
		<title>Export Single Trial Data</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export_Single_Trial_Data"/>
				<updated>2021-05-05T14:53:09Z</updated>
		
		<summary type="html">&lt;p&gt;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 = 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Rationale == &lt;br /&gt;
This article describes how to export single-trial EEG or MEG raw data for further analysis in an external program, e.g. in Matlab.  &lt;br /&gt;
&lt;br /&gt;
== Steps to follow ==&lt;br /&gt;
&lt;br /&gt;
=== Load data in BESA ===&lt;br /&gt;
&lt;br /&gt;
The data are then displayed in the review window. Now you can either &lt;br /&gt;
* use the ERP module to define a condition and reject any trials with artifacts (see the BESA Help section on ERP for more information), or &lt;br /&gt;
* directly move to the export of all epochs around a particular trigger.&lt;br /&gt;
&lt;br /&gt;
=== Export data from BESA ===&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;''File &amp;amp;rarr; Export...''&amp;quot;. The [[Export#Export Dialog|export dialog]] opens:&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_1.png|500px|thumb|c|none|Figure 1 &amp;quot;Export data&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure that the options &amp;quot;Epochs around triggers&amp;quot; and &amp;quot;Original data&amp;quot; are selected. In the section &amp;quot;Target formats&amp;quot;, choose the option of choice:&lt;br /&gt;
* If you want to create ASCII files for offline analysis, select &amp;quot;[[ASCII File Format#ASCII Multiplexed file format|ASCII multiplexed]]&amp;quot; or &amp;quot;[[ASCII File Format#ASCII Vectorized file format|ASCII vectorized]]&amp;quot;&lt;br /&gt;
* If you want to analyze data directly in Matlab, select &amp;quot;[[#Data in MATLAB|Send to MATLAB]]&amp;quot; &lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;''Interval...''&amp;quot; select a long enough time span as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_2.png|213px|thumb|c|none|Figure 2 &amp;quot;Epoch around trigger&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
Then click the &amp;quot;''Triggers...''&amp;quot; button to select which trigger code or condition will be used.&lt;br /&gt;
&lt;br /&gt;
If you want to export the epochs around a trigger code: Make sure that the trigger code you want is selected - e.g. the trigger code 1 in this example.&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_3.png|500px|thumb|c|none|Figure 3 &amp;quot;Trigger codes&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to export the epochs around a condition: Check the box &amp;quot;Conditions&amp;quot;. Then ensure that the condition of choice is selected (e.g. condition &amp;quot;Rare&amp;quot; in the example in Figure 4).&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_4.png|500px|thumb|c|none|Figure 4 &amp;quot;Epoch around condition&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After clicking &amp;quot;OK&amp;quot; BESA Research either exports the data, or - if that option was chosen - sends the data to Matlab.&lt;br /&gt;
In case of Matlab, it opens the Matlab window and creates the structure &amp;quot;besa_channels&amp;quot;. From Matlab save the structure as &amp;quot;besa_channels.mat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Data in MATLAB ===&lt;br /&gt;
&lt;br /&gt;
The MATLAB structure &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt; contains several fields like in the following example of a 64-channel EEG file with 39 trials that survived the artifact scan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
              datafile: [1x93 char]&lt;br /&gt;
          channeltypes: {1x64 cell}&lt;br /&gt;
         channellabels: {1x64 cell}&lt;br /&gt;
          channelunits: {1x64 cell}&lt;br /&gt;
    channelcoordinates: [64x9 double]&lt;br /&gt;
               montage: 'Original'&lt;br /&gt;
               filters: 'Filters off'&lt;br /&gt;
          samplingrate: 100&lt;br /&gt;
        HSPcoordinates: [3x3 double]&lt;br /&gt;
              HSPtypes: {'Fiducial'  'Fiducial'  'Fiducial'}&lt;br /&gt;
             HSPlabels: {'FidNz'  'FidT9'  'FidT10'}&lt;br /&gt;
            headcenter: [-0.0020 8.1247e-004 0.0291]&lt;br /&gt;
            headradius: 0.1021&lt;br /&gt;
    electrodethickness: 0&lt;br /&gt;
            structtype: 'besa_channels'&lt;br /&gt;
              datatype: 'Epoched_Data'&lt;br /&gt;
                  data: [1x39 struct]&lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sub-structure data contains the latencies and the measured amplitudes for each channel and trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; besa_channels.data&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
1x39 struct array with fields:&lt;br /&gt;
    amplitudes&lt;br /&gt;
    timeoffsetsecs&lt;br /&gt;
    latencies&lt;br /&gt;
    event&lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]] [[Category:Data Import/Export‏‎]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export_Single_Trial_Data</id>
		<title>Export Single Trial Data</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export_Single_Trial_Data"/>
				<updated>2021-05-05T14:51:56Z</updated>
		
		<summary type="html">&lt;p&gt;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 = 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Rationale == &lt;br /&gt;
This article describes how to export single-trial EEG or MEG raw data for further analysis in an external program, e.g. in Matlab.  &lt;br /&gt;
&lt;br /&gt;
== Steps to follow ==&lt;br /&gt;
&lt;br /&gt;
=== Load data in BESA ===&lt;br /&gt;
&lt;br /&gt;
The data are then displayed in the review window. Now you can either &lt;br /&gt;
* use the ERP module to define a condition and reject any trials with artifacts (see the BESA Help section on ERP for more information), or &lt;br /&gt;
* directly move to the export of all epochs around a particular trigger.&lt;br /&gt;
&lt;br /&gt;
=== Export data from BESA ===&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;''File &amp;amp;rarr; Export...''&amp;quot;. The [[Export#Export Dialog|export dialog]] opens:&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_1.png|500px|thumb|c|none|Figure 1 &amp;quot;Export data&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure that the options &amp;quot;Epochs around triggers&amp;quot; and &amp;quot;Original data&amp;quot; are selected. In the section &amp;quot;Target formats&amp;quot;, choose the option of choice:&lt;br /&gt;
* If you want to create ASCII files for offline analysis, select &amp;quot;[[ASCII File Format#ASCII Multiplexed file format|ASCII multiplexed]]&amp;quot; or &amp;quot;[[ASCII File Format#ASCII Vectorized file format|ASCII vectorized]]&amp;quot;&lt;br /&gt;
* If you want to analyze data directly in Matlab, select &amp;quot;Send to MATLAB&amp;quot; &lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;''Interval...''&amp;quot; select a long enough time span as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_2.png|213px|thumb|c|none|Figure 2 &amp;quot;Epoch around trigger&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
Then click the &amp;quot;''Triggers...''&amp;quot; button to select which trigger code or condition will be used.&lt;br /&gt;
&lt;br /&gt;
If you want to export the epochs around a trigger code: Make sure that the trigger code you want is selected - e.g. the trigger code 1 in this example.&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_3.png|500px|thumb|c|none|Figure 3 &amp;quot;Trigger codes&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to export the epochs around a condition: Check the box &amp;quot;Conditions&amp;quot;. Then ensure that the condition of choice is selected (e.g. condition &amp;quot;Rare&amp;quot; in the example in Figure 4).&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_4.png|500px|thumb|c|none|Figure 4 &amp;quot;Epoch around condition&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After clicking &amp;quot;OK&amp;quot; BESA Research either exports the data, or - if that option was chosen - sends the data to Matlab.&lt;br /&gt;
In case of Matlab, it opens the Matlab window and creates the structure &amp;quot;besa_channels&amp;quot;. From Matlab save the structure as &amp;quot;besa_channels.mat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Data in MATLAB ===&lt;br /&gt;
&lt;br /&gt;
The MATLAB structure &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt; contains several fields like in the following example of a 64-channel EEG file with 39 trials that survived the artifact scan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
              datafile: [1x93 char]&lt;br /&gt;
          channeltypes: {1x64 cell}&lt;br /&gt;
         channellabels: {1x64 cell}&lt;br /&gt;
          channelunits: {1x64 cell}&lt;br /&gt;
    channelcoordinates: [64x9 double]&lt;br /&gt;
               montage: 'Original'&lt;br /&gt;
               filters: 'Filters off'&lt;br /&gt;
          samplingrate: 100&lt;br /&gt;
        HSPcoordinates: [3x3 double]&lt;br /&gt;
              HSPtypes: {'Fiducial'  'Fiducial'  'Fiducial'}&lt;br /&gt;
             HSPlabels: {'FidNz'  'FidT9'  'FidT10'}&lt;br /&gt;
            headcenter: [-0.0020 8.1247e-004 0.0291]&lt;br /&gt;
            headradius: 0.1021&lt;br /&gt;
    electrodethickness: 0&lt;br /&gt;
            structtype: 'besa_channels'&lt;br /&gt;
              datatype: 'Epoched_Data'&lt;br /&gt;
                  data: [1x39 struct]&lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sub-structure data contains the latencies and the measured amplitudes for each channel and trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; besa_channels.data&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
1x39 struct array with fields:&lt;br /&gt;
    amplitudes&lt;br /&gt;
    timeoffsetsecs&lt;br /&gt;
    latencies&lt;br /&gt;
    event&lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]] [[Category:Data Import/Export‏‎]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export_Single_Trial_Data</id>
		<title>Export Single Trial Data</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export_Single_Trial_Data"/>
				<updated>2021-05-05T14:49:40Z</updated>
		
		<summary type="html">&lt;p&gt;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 = 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Rationale == &lt;br /&gt;
This article describes how to export single-trial EEG or MEG raw data for further analysis in an external program, e.g. in Matlab.  &lt;br /&gt;
&lt;br /&gt;
== Steps to follow ==&lt;br /&gt;
&lt;br /&gt;
=== Load data in BESA ===&lt;br /&gt;
&lt;br /&gt;
The data are then displayed in the review window. Now you can either &lt;br /&gt;
* use the ERP module to define a condition and reject any trials with artifacts (see the BESA Help section on ERP for more information), or &lt;br /&gt;
* directly move to the export of all epochs around a particular trigger.&lt;br /&gt;
&lt;br /&gt;
=== Export data from BESA ===&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;''File &amp;amp;rarr; Export...''&amp;quot;. The [[Export#Export Dialog|export dialog]] opens:&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_1.png|500px|thumb|c|none|Figure 1 &amp;quot;Export data&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure that the options &amp;quot;Epochs around triggers&amp;quot; and &amp;quot;Original data&amp;quot; are selected. In the section &amp;quot;Target formats&amp;quot;, choose the option of choice:&lt;br /&gt;
* If you want to create ASCII files for offline analysis, select &amp;quot;ASCII multiplexed&amp;quot; or &amp;quot;ASCII vectorized&amp;quot;&lt;br /&gt;
* If you want to analyze data directly in Matlab, select &amp;quot;Send to MATLAB&amp;quot; &lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;''Interval...''&amp;quot; select a long enough time span as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_2.png|213px|thumb|c|none|Figure 2 &amp;quot;Epoch around trigger&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
Then click the &amp;quot;''Triggers...''&amp;quot; button to select which trigger code or condition will be used.&lt;br /&gt;
&lt;br /&gt;
If you want to export the epochs around a trigger code: Make sure that the trigger code you want is selected - e.g. the trigger code 1 in this example.&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_3.png|500px|thumb|c|none|Figure 3 &amp;quot;Trigger codes&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to export the epochs around a condition: Check the box &amp;quot;Conditions&amp;quot;. Then ensure that the condition of choice is selected (e.g. condition &amp;quot;Rare&amp;quot; in the example in Figure 4).&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_4.png|500px|thumb|c|none|Figure 4 &amp;quot;Epoch around condition&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After clicking &amp;quot;OK&amp;quot; BESA Research either exports the data, or - if that option was chosen - sends the data to Matlab.&lt;br /&gt;
In case of Matlab, it opens the Matlab window and creates the structure &amp;quot;besa_channels&amp;quot;. From Matlab save the structure as &amp;quot;besa_channels.mat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Data in MATLAB ===&lt;br /&gt;
&lt;br /&gt;
The MATLAB structure &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt; contains several fields like in the following example of a 64-channel EEG file with 39 trials that survived the artifact scan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
              datafile: [1x93 char]&lt;br /&gt;
          channeltypes: {1x64 cell}&lt;br /&gt;
         channellabels: {1x64 cell}&lt;br /&gt;
          channelunits: {1x64 cell}&lt;br /&gt;
    channelcoordinates: [64x9 double]&lt;br /&gt;
               montage: 'Original'&lt;br /&gt;
               filters: 'Filters off'&lt;br /&gt;
          samplingrate: 100&lt;br /&gt;
        HSPcoordinates: [3x3 double]&lt;br /&gt;
              HSPtypes: {'Fiducial'  'Fiducial'  'Fiducial'}&lt;br /&gt;
             HSPlabels: {'FidNz'  'FidT9'  'FidT10'}&lt;br /&gt;
            headcenter: [-0.0020 8.1247e-004 0.0291]&lt;br /&gt;
            headradius: 0.1021&lt;br /&gt;
    electrodethickness: 0&lt;br /&gt;
            structtype: 'besa_channels'&lt;br /&gt;
              datatype: 'Epoched_Data'&lt;br /&gt;
                  data: [1x39 struct]&lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sub-structure data contains the latencies and the measured amplitudes for each channel and trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; besa_channels.data&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
1x39 struct array with fields:&lt;br /&gt;
    amplitudes&lt;br /&gt;
    timeoffsetsecs&lt;br /&gt;
    latencies&lt;br /&gt;
    event&lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]] [[Category:Data Import/Export‏‎]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export_Single_Trial_Data</id>
		<title>Export Single Trial Data</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export_Single_Trial_Data"/>
				<updated>2021-05-05T14:48:33Z</updated>
		
		<summary type="html">&lt;p&gt;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 = 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Rationale == &lt;br /&gt;
This article describes how to export single-trial EEG or MEG raw data for further analysis in an external program, e.g. in Matlab.  &lt;br /&gt;
&lt;br /&gt;
== Steps to follow ==&lt;br /&gt;
&lt;br /&gt;
=== Load data in BESA ===&lt;br /&gt;
&lt;br /&gt;
The data are then displayed in the review window. Now you can either &lt;br /&gt;
* use the ERP module to define a condition and reject any trials with artifacts (see the BESA Help section on ERP for more information), or &lt;br /&gt;
* directly move to the export of all epochs around a particular trigger.&lt;br /&gt;
&lt;br /&gt;
=== Export data from BESA ===&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;''File &amp;amp;rarr; Export...''&amp;quot;. The [[Export:Export Dialog|export dialog]] opens:&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_1.png|500px|thumb|c|none|Figure 1 &amp;quot;Export data&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure that the options &amp;quot;Epochs around triggers&amp;quot; and &amp;quot;Original data&amp;quot; are selected. In the section &amp;quot;Target formats&amp;quot;, choose the option of choice:&lt;br /&gt;
* If you want to create ASCII files for offline analysis, select &amp;quot;ASCII multiplexed&amp;quot; or &amp;quot;ASCII vectorized&amp;quot;&lt;br /&gt;
* If you want to analyze data directly in Matlab, select &amp;quot;Send to MATLAB&amp;quot; &lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;''Interval...''&amp;quot; select a long enough time span as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_2.png|213px|thumb|c|none|Figure 2 &amp;quot;Epoch around trigger&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
Then click the &amp;quot;''Triggers...''&amp;quot; button to select which trigger code or condition will be used.&lt;br /&gt;
&lt;br /&gt;
If you want to export the epochs around a trigger code: Make sure that the trigger code you want is selected - e.g. the trigger code 1 in this example.&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_3.png|500px|thumb|c|none|Figure 3 &amp;quot;Trigger codes&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to export the epochs around a condition: Check the box &amp;quot;Conditions&amp;quot;. Then ensure that the condition of choice is selected (e.g. condition &amp;quot;Rare&amp;quot; in the example in Figure 4).&lt;br /&gt;
&lt;br /&gt;
[[File:Export_epochs_4.png|500px|thumb|c|none|Figure 4 &amp;quot;Epoch around condition&amp;quot; dialog]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After clicking &amp;quot;OK&amp;quot; BESA Research either exports the data, or - if that option was chosen - sends the data to Matlab.&lt;br /&gt;
In case of Matlab, it opens the Matlab window and creates the structure &amp;quot;besa_channels&amp;quot;. From Matlab save the structure as &amp;quot;besa_channels.mat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Data in MATLAB ===&lt;br /&gt;
&lt;br /&gt;
The MATLAB structure &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt; contains several fields like in the following example of a 64-channel EEG file with 39 trials that survived the artifact scan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
              datafile: [1x93 char]&lt;br /&gt;
          channeltypes: {1x64 cell}&lt;br /&gt;
         channellabels: {1x64 cell}&lt;br /&gt;
          channelunits: {1x64 cell}&lt;br /&gt;
    channelcoordinates: [64x9 double]&lt;br /&gt;
               montage: 'Original'&lt;br /&gt;
               filters: 'Filters off'&lt;br /&gt;
          samplingrate: 100&lt;br /&gt;
        HSPcoordinates: [3x3 double]&lt;br /&gt;
              HSPtypes: {'Fiducial'  'Fiducial'  'Fiducial'}&lt;br /&gt;
             HSPlabels: {'FidNz'  'FidT9'  'FidT10'}&lt;br /&gt;
            headcenter: [-0.0020 8.1247e-004 0.0291]&lt;br /&gt;
            headradius: 0.1021&lt;br /&gt;
    electrodethickness: 0&lt;br /&gt;
            structtype: 'besa_channels'&lt;br /&gt;
              datatype: 'Epoched_Data'&lt;br /&gt;
                  data: [1x39 struct]&lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sub-structure data contains the latencies and the measured amplitudes for each channel and trial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; besa_channels.data&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
1x39 struct array with fields:&lt;br /&gt;
    amplitudes&lt;br /&gt;
    timeoffsetsecs&lt;br /&gt;
    latencies&lt;br /&gt;
    event&lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]] [[Category:Data Import/Export‏‎]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export_Connectivity_Results</id>
		<title>Export Connectivity Results</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export_Connectivity_Results"/>
				<updated>2021-05-05T14:42:31Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Connectivity&lt;br /&gt;
|version = BESA Connectivity 1.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
BESA Connectivity provides export of connectivity results via the menu entry ''Export'' → ''Export Results'' → ''Export Connectivity Data''. This option will export the entire connectivity matrix (for all latencies and frequencies) of the currently selected connectivity method, time-frequency decomposition method and condition.&lt;br /&gt;
&lt;br /&gt;
[[File:BESA Connectivity Selected Connectivity and Time-Frequency Methods.png]]&lt;br /&gt;
&lt;br /&gt;
The connectivity matrix is written in a simple ASCII file that can be opened and edited with a text editor (e.g.: Notepad). The extension .conn will be added.&lt;br /&gt;
The first line of the connectivity results file format is a comma-separated list of information on the expoted data. It contains the following key - value pairs:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight:bold;&amp;quot; | Key&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight:bold;&amp;quot; | Value&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight:bold;&amp;quot; | Description&lt;br /&gt;
|-&lt;br /&gt;
| VersionNumber&lt;br /&gt;
| 1.0&lt;br /&gt;
| File format version&lt;br /&gt;
|-&lt;br /&gt;
| DataType&lt;br /&gt;
| Coherence / Granger Causality, etc.&lt;br /&gt;
| Connectivity method&lt;br /&gt;
|-&lt;br /&gt;
| DecompositionType&lt;br /&gt;
| Complex Demodulation / Wavelet Transform&lt;br /&gt;
| Time-frequency method&lt;br /&gt;
|-&lt;br /&gt;
| ConditionName&lt;br /&gt;
| Stimulus condition&lt;br /&gt;
| Name of condition&lt;br /&gt;
|-&lt;br /&gt;
| NumberTrials&lt;br /&gt;
| 12&lt;br /&gt;
| Number of trials&lt;br /&gt;
|-&lt;br /&gt;
| NumberTimeSamples&lt;br /&gt;
| 120&lt;br /&gt;
| Number of latencies&lt;br /&gt;
|-&lt;br /&gt;
| TimeStartInMS&lt;br /&gt;
| -400.0000&lt;br /&gt;
| Start latency in [ms]&lt;br /&gt;
|-&lt;br /&gt;
| IntervalInMS&lt;br /&gt;
| 50.0000&lt;br /&gt;
| Latency spacing in [ms]&lt;br /&gt;
|-&lt;br /&gt;
| NumberFrequencies&lt;br /&gt;
| 31&lt;br /&gt;
| Number of frequencies&lt;br /&gt;
|-&lt;br /&gt;
| FreqStartInHz&lt;br /&gt;
| 2.000&lt;br /&gt;
| Start frequency in [Hz]&lt;br /&gt;
|-&lt;br /&gt;
| FreqIntervalInHz&lt;br /&gt;
| 1.000&lt;br /&gt;
| Frequency spacing in [Hz]&lt;br /&gt;
|-&lt;br /&gt;
| NumberChannels&lt;br /&gt;
| 64&lt;br /&gt;
| Number of channels/sources&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The second line defines the channel/source labels. Please note that the list is comma-separated, therefore the list of labels must not contain spaces!&lt;br /&gt;
&lt;br /&gt;
'''Example header'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
VersionNumber=1.0 DataType=Coherence DecompositionType=Complex Demodulation ConditionName=Condition 1 NumberTrials=10 NumberTimeSamples=33 TimeStartInMS=-400.0000 IntervalInMS=50.0000 NumberFrequencies=31 FreqStartInHz=2.0000 FreqIntervalInHz=1.0000 NumberChannels=3 &lt;br /&gt;
ACsR_RC0 ACsL_RC0 PrM_RC0 &lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the file header, the connectivity data is exported column-wise as indicated in the following image: &lt;br /&gt;
&lt;br /&gt;
[[File:BESA_Connectivity_Data_Blocks.png]]&lt;br /&gt;
&lt;br /&gt;
The columns of each data block indicate the latencies, starting with the earliest latency (first column) up to the latest latency (last column). There should be as many columns in each data block as specified in the header by the value of the ''NumberTimeSamples'' key. The rows of each data block indicate the frequencies, starting with the lowest frequency (first row) up to the maximum frequency (last row). There should be as many rows in each data block as specified in the header by the value of the ''NumberFrequencies'' key.&lt;br /&gt;
&lt;br /&gt;
[[Category:Connectivity]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export_Connectivity_Results</id>
		<title>Export Connectivity Results</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export_Connectivity_Results"/>
				<updated>2021-05-05T14:41:48Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BESAInfobox&lt;br /&gt;
|title = Module information&lt;br /&gt;
|module = BESA Connectivity&lt;br /&gt;
|version = BESA Connectivity 1.0 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
BESA Connectivity provides export of connectivity results via the menu entry ''Export'' → ''Export Results'' → ''Export Connectivity Data''. This option will export the entire connectivity matrix (for all latencies and frequencies) of the currently selected connectivity method, time-frequency decomposition method and condition.&lt;br /&gt;
&lt;br /&gt;
[[File:BESA Connectivity Selected Connectivity and Time-Frequency Methods.png]]&lt;br /&gt;
&lt;br /&gt;
The connectivity matrix is written in a simple ASCII file that can be opened and edited with a text editor (e.g.: Notepad, Notepad++). The extension .conn will be added.&lt;br /&gt;
The first line of the connectivity results file format is a comma-separated list of information on the expoted data. It contains the following key - value pairs:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight:bold;&amp;quot; | Key&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight:bold;&amp;quot; | Value&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight:bold;&amp;quot; | Description&lt;br /&gt;
|-&lt;br /&gt;
| VersionNumber&lt;br /&gt;
| 1.0&lt;br /&gt;
| File format version&lt;br /&gt;
|-&lt;br /&gt;
| DataType&lt;br /&gt;
| Coherence / Granger Causality, etc.&lt;br /&gt;
| Connectivity method&lt;br /&gt;
|-&lt;br /&gt;
| DecompositionType&lt;br /&gt;
| Complex Demodulation / Wavelet Transform&lt;br /&gt;
| Time-frequency method&lt;br /&gt;
|-&lt;br /&gt;
| ConditionName&lt;br /&gt;
| Stimulus condition&lt;br /&gt;
| Name of condition&lt;br /&gt;
|-&lt;br /&gt;
| NumberTrials&lt;br /&gt;
| 12&lt;br /&gt;
| Number of trials&lt;br /&gt;
|-&lt;br /&gt;
| NumberTimeSamples&lt;br /&gt;
| 120&lt;br /&gt;
| Number of latencies&lt;br /&gt;
|-&lt;br /&gt;
| TimeStartInMS&lt;br /&gt;
| -400.0000&lt;br /&gt;
| Start latency in [ms]&lt;br /&gt;
|-&lt;br /&gt;
| IntervalInMS&lt;br /&gt;
| 50.0000&lt;br /&gt;
| Latency spacing in [ms]&lt;br /&gt;
|-&lt;br /&gt;
| NumberFrequencies&lt;br /&gt;
| 31&lt;br /&gt;
| Number of frequencies&lt;br /&gt;
|-&lt;br /&gt;
| FreqStartInHz&lt;br /&gt;
| 2.000&lt;br /&gt;
| Start frequency in [Hz]&lt;br /&gt;
|-&lt;br /&gt;
| FreqIntervalInHz&lt;br /&gt;
| 1.000&lt;br /&gt;
| Frequency spacing in [Hz]&lt;br /&gt;
|-&lt;br /&gt;
| NumberChannels&lt;br /&gt;
| 64&lt;br /&gt;
| Number of channels/sources&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The second line defines the channel/source labels. Please note that the list is comma-separated, therefore the list of labels must not contain spaces!&lt;br /&gt;
&lt;br /&gt;
'''Example header'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
VersionNumber=1.0 DataType=Coherence DecompositionType=Complex Demodulation ConditionName=Condition 1 NumberTrials=10 NumberTimeSamples=33 TimeStartInMS=-400.0000 IntervalInMS=50.0000 NumberFrequencies=31 FreqStartInHz=2.0000 FreqIntervalInHz=1.0000 NumberChannels=3 &lt;br /&gt;
ACsR_RC0 ACsL_RC0 PrM_RC0 &lt;br /&gt;
&amp;lt;/source &amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the file header, the connectivity data is exported column-wise as indicated in the following image: &lt;br /&gt;
&lt;br /&gt;
[[File:BESA_Connectivity_Data_Blocks.png]]&lt;br /&gt;
&lt;br /&gt;
The columns of each data block indicate the latencies, starting with the earliest latency (first column) up to the latest latency (last column). There should be as many columns in each data block as specified in the header by the value of the ''NumberTimeSamples'' key. The rows of each data block indicate the frequencies, starting with the lowest frequency (first row) up to the maximum frequency (last row). There should be as many rows in each data block as specified in the header by the value of the ''NumberFrequencies'' key.&lt;br /&gt;
&lt;br /&gt;
[[Category:Connectivity]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export</id>
		<title>Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export"/>
				<updated>2021-05-05T14:41:16Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Exporting files from BESA ==&lt;br /&gt;
&lt;br /&gt;
Data can be exported from BESA Research in the following formats:&lt;br /&gt;
* BESA's own binary format (compressed or uncompressed)&lt;br /&gt;
* ASCII multiplexed&lt;br /&gt;
* ASCII vectorized (short files only)&lt;br /&gt;
* EDF+&lt;br /&gt;
* Simple floating point matrix (e.g. for exporting data to Matlab)&lt;br /&gt;
* Send the data directly to Matlab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can export&lt;br /&gt;
* The entire data set or between markers&lt;br /&gt;
* The currently marked segment&lt;br /&gt;
* Epochs around triggers&lt;br /&gt;
* Standard deviations from binary average files (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''*.fsg'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Export is allowed to various montages:&lt;br /&gt;
* filtered or unfiltered data&lt;br /&gt;
* original data&lt;br /&gt;
* current montage (including artifact correction if applied)&lt;br /&gt;
* standard 81-electrode montage.&lt;br /&gt;
&lt;br /&gt;
On export, you can choose to change the sampling rate.&lt;br /&gt;
&lt;br /&gt;
If exporting to BESA's binary format, you can optionally append the data to a preexisting data set, if sampling rates and the number of channels match. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start export you have to:&lt;br /&gt;
* select File / Export...&lt;br /&gt;
* press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS '''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
* for Send to Matlab only: select File / Send To MATLAB... This also opens the Export Dialog, but only the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Send To Matlab radio'''&amp;lt;/span&amp;gt; button is enabled as target format in the dialog.&lt;br /&gt;
&lt;br /&gt;
== Export Dialog ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The dialog is started when you select'' File / Export...'' or press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS'''&amp;lt;/span&amp;gt; button or select '''Write Segment''' in the right click context menu when a segment has been highlighted.&lt;br /&gt;
&lt;br /&gt;
The dialog is divided into four sections:&lt;br /&gt;
* ''Data to export''. Describes which data are to be exported.&lt;br /&gt;
* ''Montage and Filters.'' Which montage is to be exported, and whether or not filters are used.&lt;br /&gt;
* ''Target data formats''. Specify the format of the exported data.&lt;br /&gt;
* ''Resampling.'' Specify a new sampling rate in the exported data.&lt;br /&gt;
&lt;br /&gt;
''Anonymize using target file name'': Export can be performed either with or without anonymizing using the checkbox &amp;quot;Anonymize using target file name&amp;quot;. When the checkbox is checked, the subject name is replaced by a target file name, and the subject birth date is replaced by 1st July of the subject birth year.&lt;br /&gt;
&lt;br /&gt;
== Type of data to export ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (2).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The types of data to export are:&lt;br /&gt;
* '''Continuous data'''. The whole data set or the data between markers are exported.&lt;br /&gt;
* '''Marked segment.''' If a segment of data is highlighted, this radio button is enabled. Select Marked segment to export just this segment.&lt;br /&gt;
* '''Epochs around triggers.''' Export data segments around triggers. If this item is selected, the two buttons &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Interval'''&amp;lt;/span&amp;gt;... and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Triggers'''&amp;lt;/span&amp;gt;... are enabled. They allow to select the interval (cf ''Edit / Default'' ''Block Epoch''...), and choose among the available triggers (see ''Edit / Trigger Values''...). Note that the default block epoch values are persistent across BESA Research sessions. The trigger selection is not persistent!&lt;br /&gt;
* '''Standard Deviations (from fsg file only).''' If the average file was generated using the BESA Research ERP module, standard deviations are saved in the file. Check this item to export these values to an ASCII file.&lt;br /&gt;
&lt;br /&gt;
'''Between markers.''' If there are markers in the file, and '''Marked segment''' is not selected, selecting '''Between markers''' will result in the export of data between markers relative to the current position in the file (as defined by the middle of the current display), either:&lt;br /&gt;
* if there is no previous marker, from the beginning of the file to the next marker, or&lt;br /&gt;
* from the previous to the next marker, or&lt;br /&gt;
* if there is no next marker, from the previous marker to the end of the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Montages and Filters ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The data can be exported either&lt;br /&gt;
&lt;br /&gt;
* '''Original data.''' The data are exported using the original montage&lt;br /&gt;
&lt;br /&gt;
* '''Current montage.''' The currently selected montage is exported. If extra channels, e.g. selected channels or artifact waveforms are displayed, these are exported as well. Notes:&lt;br /&gt;
** When 'Current Montage' is selected, no auxiliary files are exported. When re-importing the data into BESA Research, all channels will be defined as polygraphic.&lt;br /&gt;
** If the current data is artifact-corrected, the artifact-corrected data will be exported when 'Current Montage' is selected.&lt;br /&gt;
&lt;br /&gt;
* '''Standard 81 electrode locations.''' EEG data are interpolated to a set of 81 electrodes on a standard head (average over 24 mainly Caucasian heads).&lt;br /&gt;
&lt;br /&gt;
* Export can be performed either with or without the currently selected filters. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Filters'''&amp;lt;/span&amp;gt;... button to change the current filter settings (see also ''Filters / Edit Filter Settings''...). Note that if artifact correction was performed and this checkbox is enabled, data will be exported with artifact correction. &lt;br /&gt;
&lt;br /&gt;
== Target Data Formats ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (4).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following target formats are available:&lt;br /&gt;
&lt;br /&gt;
* '''BESA binary''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt;&amp;quot; or &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.fsg'''&amp;lt;/span&amp;gt;&amp;quot;. You can select whether to export with no compression (recommended for averages), or compressed (recommended for raw data). Note that compression can result in loss of resolution in averaged data. See [[Export#Data_Compression|Data Compression]].&lt;br /&gt;
&lt;br /&gt;
* '''ASCII multiplexed''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Multiplexed_file_format|ASCII multiplexed format]] for a description of the data format. If the type of data to export is '''Epochs''' '''around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
* '''ASCII vectorized''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.avr'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Vectorized_file_format|ASCII vectorized format]] for a description of the data format. If the type of data to export is '''Epochs around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc. The data are not average referenced before saving. They will only be average referenced if the data are exported using an average referenced '''Current montage'''. You are only allowed to export small segments in vectorized format. If you have selected '''Continuous data''', this item will be disabled if the data are longer than 20 s in duration.&lt;br /&gt;
&lt;br /&gt;
* '''European Data Format (EDF+)''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.edf'''&amp;lt;/span&amp;gt;&amp;quot;. Export of '''Epochs around triggers''' to EDF+ is currently not possible.&lt;br /&gt;
&lt;br /&gt;
* '''Simple binary matrix''': Data are written to a floating point binary matrix with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.dat'''&amp;lt;/span&amp;gt;&amp;quot;. The matrix has the dimension no of samples x no of channels. In addition, a header file with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.generic'''&amp;lt;/span&amp;gt;&amp;quot; is also written. The header file is a text file contains information about the number of channels, sampling rate, and number of samples. These follow the specifications of the Generic File Format. This data format can be useful as a means of transferring data to other programs (e.g. '''MATLAB''') in a relatively compact form. If the type of data to export is '''Epochs around triggers''', the epochs are concatenated in the same target file. In this case, the header file contains a line specifying the number of epochs (cf. ''Generic File Format''). The number of samples in each epoch is the total number of samples, divided by the number of epochs.&lt;br /&gt;
&lt;br /&gt;
* '''Send To MATLAB''': The data are exported directly to MATLAB into the struct variable &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt;. For more information on the data transfer from BESA Research to MATLAB, please refer to the Help chapter [[MATLAB_Interface | MATLAB interface]].&lt;br /&gt;
&lt;br /&gt;
== Resampling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check '''Resample data''' to change the sampling rate of the target data. The edit box is enabled, and you specify a sampling rate.&lt;br /&gt;
&lt;br /&gt;
Data are resampled using splines. Thus, the new sampling rate is not limited to fractions or multiples of the original rate.&lt;br /&gt;
&lt;br /&gt;
Note that if '''Resample data''' is not checked, the sampling rate of the source data is displayed.&lt;br /&gt;
&lt;br /&gt;
'''Resampling and aliasing'''. If you want to reduce the sampling rate it is important to avoid aliasing! It is recommended that a low-pass filter with a boundary frequency of not more than 1/3 of the original sampling rate is used. When you set a new sampling rate, BESA Research checks the current filter settings. If export without filters is selected, or if the current low-pass filter is set to a value that is higher than 1/3 of the sampling rate, BESA Research sets the filter, and opens a message box with a warning:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You may adjust the filters by pressing the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Filter'''&amp;lt;/span&amp;gt; button, e.g. if the original data were already recorded with a sufficiently low low-pass filter setting, so that additional filtering is unnecessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Compression ==&lt;br /&gt;
&lt;br /&gt;
When exporting to BESA binary format and ASCII multiplex formats, you can compress the data to save space. Here we describe properties and pitfalls of the compression algorithm.&lt;br /&gt;
&lt;br /&gt;
=== Compression of BESA binary data ===&lt;br /&gt;
&lt;br /&gt;
'''How compression works'''&lt;br /&gt;
&lt;br /&gt;
The compression algorithm works on two principals:&lt;br /&gt;
* '''Data resolution can often be reduced without losing data quality.''' For instance, a data resolution of 0.1 µV or higher is unnecessary for viewing normal EEG -- 0.5 µV or 1 µV steps are sufficient. Similarly for event-related potentials: the raw data only require a resolution of 0.5 µV or 1 µV to achieve a much higher resolution after averaging.&lt;br /&gt;
* '''Differences between successive data samples''' on a signal are generally much smaller than '''the absolute values of the data'''. Thus, one start value, and then a series of subsequent differences can be stored in a much smaller space than an equivalent series of absolute values. A consequence of this principle is that smoothed signals (with high frequencies removed) can be compressed into a smaller space than signals with a lot of high frequency noise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Compression parameter'''&lt;br /&gt;
&lt;br /&gt;
The parameter you need to choose is the data resolution, or step size. Steps smaller than this size will no longer be represented in the compressed data. The BESA Research Export Module allows the following steps for the compression of EEG signals:&lt;br /&gt;
&lt;br /&gt;
0.1 µV, 0.2 µV, 0.5 µV, 1 µV&lt;br /&gt;
&lt;br /&gt;
For raw EEG data, we recommend using a step size of 0.5 µV.&lt;br /&gt;
&lt;br /&gt;
'''Different compression parameters for different data types (pitfalls!)'''&lt;br /&gt;
&lt;br /&gt;
As described above, the step sizes make sense for EEG signals. For other types of data, other step sizes make more sense. In addition, a polygraphic signal can have the same order of signal magnitude as the EEG (e.g. an EOG or EKG signal), but it might have a completely different scale, e.g. a voice signal, recorded in mV or V. To help accommodate different orders of signal magnitude, BESA Research applies the following rules:&lt;br /&gt;
* '''MEG data:''' Step sizes (in units of fT) are 20 x the step size in µV. Thus, a step size of 0.5 µV will lead to a step size of 10 fT for MEG data.&lt;br /&gt;
* '''Polygraphic and ICR data''': The step size depends on the current amplitude scaling factor in BESA Research. A multiplication factor is used that is the current scaling factor, divided by 100. Thus, if the scale is set to 1 V, the factor is 10 mV. If you have chosen an EEG step size of 0.5 µV, the resulting step size will be 10 x 0.5 = 5 mV.&lt;br /&gt;
&lt;br /&gt;
A pitfall in compression is that if the current amplitude scaling for polygraphic or ICR data does not display the signal sensibly, compression may lead to complete loss of the signal. Note that this only applies to polygraphic and ICR channel types.&lt;br /&gt;
&lt;br /&gt;
* '''Averages:''' We recommend that averaged ERPs are not compressed. Since the signals are generally much smaller than the raw data, compression will lead to unacceptable loss of data resolution.&lt;br /&gt;
&lt;br /&gt;
=== Compression of ASCII multiplexed data ===&lt;br /&gt;
&lt;br /&gt;
When compression is specified, data are written as integer values, and the scaling is specified in the header line of the *.mul file as ''Bins/uV=xxx''. &lt;br /&gt;
&lt;br /&gt;
With no compression, the header contains ''Bins/uV=1.0'', and the data are written with 7 characters per number (e.g. -4.5084, 2.57239).&lt;br /&gt;
&lt;br /&gt;
With compression, the data are written as integers, e.g. 0 -10 -6 -4, which can lead to considerably less characters and thus&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! No compression&lt;br /&gt;
! 0.1&lt;br /&gt;
! 0.2&lt;br /&gt;
! 0.5&lt;br /&gt;
! 1.0&lt;br /&gt;
|-&lt;br /&gt;
| -4.5084&lt;br /&gt;
| -4.5 (-45)&lt;br /&gt;
| -4.6 (-23)&lt;br /&gt;
| -4.5 (-9)&lt;br /&gt;
| -5.0 (-5)&lt;br /&gt;
|-&lt;br /&gt;
| 2.57239&lt;br /&gt;
| 2.6 (26)&lt;br /&gt;
| 2.6 (13)&lt;br /&gt;
| 2.5 (5)&lt;br /&gt;
| 3.0 (3)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The numbers in brackets are the values written to the data file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export</id>
		<title>Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export"/>
				<updated>2021-05-05T14:33:28Z</updated>
		
		<summary type="html">&lt;p&gt;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;
== Exporting files from BESA ==&lt;br /&gt;
&lt;br /&gt;
Data can be exported from BESA Research in the following formats:&lt;br /&gt;
* BESA's own binary format (compressed or uncompressed)&lt;br /&gt;
* ASCII multiplexed&lt;br /&gt;
* ASCII vectorized (short files only)&lt;br /&gt;
* EDF+&lt;br /&gt;
* Simple floating point matrix (e.g. for exporting data to Matlab)&lt;br /&gt;
* Send the data directly to Matlab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can export&lt;br /&gt;
* The entire data set or between markers&lt;br /&gt;
* The currently marked segment&lt;br /&gt;
* Epochs around triggers&lt;br /&gt;
* Standard deviations from binary average files (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''*.fsg'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Export is allowed to various montages:&lt;br /&gt;
* filtered or unfiltered data&lt;br /&gt;
* original data&lt;br /&gt;
* current montage (including artifact correction if applied)&lt;br /&gt;
* standard 81-electrode montage.&lt;br /&gt;
&lt;br /&gt;
On export, you can choose to change the sampling rate.&lt;br /&gt;
&lt;br /&gt;
If exporting to BESA's binary format, you can optionally append the data to a preexisting data set, if sampling rates and the number of channels match. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start export you have to:&lt;br /&gt;
* select File / Export...&lt;br /&gt;
* press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS '''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
* for Send to Matlab only: select File / Send To MATLAB... This also opens the Export Dialog, but only the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Send To Matlab radio'''&amp;lt;/span&amp;gt; button is enabled as target format in the dialog.&lt;br /&gt;
&lt;br /&gt;
== Export Dialog ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The dialog is started when you select'' File / Export...'' or press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS'''&amp;lt;/span&amp;gt; button or select '''Write Segment''' in the right click context menu when a segment has been highlighted.&lt;br /&gt;
&lt;br /&gt;
The dialog is divided into four sections:&lt;br /&gt;
* ''Data to export''. Describes which data are to be exported.&lt;br /&gt;
* ''Montage and Filters.'' Which montage is to be exported, and whether or not filters are used.&lt;br /&gt;
* ''Target data formats''. Specify the format of the exported data.&lt;br /&gt;
* ''Resampling.'' Specify a new sampling rate in the exported data.&lt;br /&gt;
&lt;br /&gt;
''Anonymize using target file name'': Export can be performed either with or without anonymizing using the checkbox &amp;quot;Anonymize using target file name&amp;quot;. When the checkbox is checked, the subject name is replaced by a target file name, and the subject birth date is replaced by 1st July of the subject birth year.&lt;br /&gt;
&lt;br /&gt;
== Type of data to export ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (2).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The types of data to export are:&lt;br /&gt;
* '''Continuous data'''. The whole data set or the data between markers are exported.&lt;br /&gt;
* '''Marked segment.''' If a segment of data is highlighted, this radio button is enabled. Select Marked segment to export just this segment.&lt;br /&gt;
* '''Epochs around triggers.''' Export data segments around triggers. If this item is selected, the two buttons &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Interval'''&amp;lt;/span&amp;gt;... and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Triggers'''&amp;lt;/span&amp;gt;... are enabled. They allow to select the interval (cf ''Edit / Default'' ''Block Epoch''...), and choose among the available triggers (see ''Edit / Trigger Values''...). Note that the default block epoch values are persistent across BESA Research sessions. The trigger selection is not persistent!&lt;br /&gt;
* '''Standard Deviations (from fsg file only).''' If the average file was generated using the BESA Research ERP module, standard deviations are saved in the file. Check this item to export these values to an ASCII file.&lt;br /&gt;
&lt;br /&gt;
'''Between markers.''' If there are markers in the file, and '''Marked segment''' is not selected, selecting '''Between markers''' will result in the export of data between markers relative to the current position in the file (as defined by the middle of the current display), either:&lt;br /&gt;
* if there is no previous marker, from the beginning of the file to the next marker, or&lt;br /&gt;
* from the previous to the next marker, or&lt;br /&gt;
* if there is no next marker, from the previous marker to the end of the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Montages and Filters ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The data can be exported either&lt;br /&gt;
&lt;br /&gt;
* '''Original data.''' The data are exported using the original montage&lt;br /&gt;
&lt;br /&gt;
* '''Current montage.''' The currently selected montage is exported. If extra channels, e.g. selected channels or artifact waveforms are displayed, these are exported as well. Notes:&lt;br /&gt;
** When 'Current Montage' is selected, no auxiliary files are exported. When re-importing the data into BESA Research, all channels will be defined as polygraphic.&lt;br /&gt;
** If the current data is artifact-corrected, the artifact-corrected data will be exported when 'Current Montage' is selected.&lt;br /&gt;
&lt;br /&gt;
* '''Standard 81 electrode locations.''' EEG data are interpolated to a set of 81 electrodes on a standard head (average over 24 mainly Caucasian heads).&lt;br /&gt;
&lt;br /&gt;
* Export can be performed either with or without the currently selected filters. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Filters'''&amp;lt;/span&amp;gt;... button to change the current filter settings (see also ''Filters / Edit Filter Settings''...). Note that if artifact correction was performed and this checkbox is enabled, data will be exported with artifact correction. &lt;br /&gt;
&lt;br /&gt;
== Target Data Formats ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (4).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following target formats are available:&lt;br /&gt;
&lt;br /&gt;
* '''BESA binary''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt;&amp;quot; or &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.fsg'''&amp;lt;/span&amp;gt;&amp;quot;. You can select whether to export with no compression (recommended for averages), or compressed (recommended for raw data). Note that compression can result in loss of resolution in averaged data. See [[Export#Data_Compression|Data Compression]].&lt;br /&gt;
&lt;br /&gt;
* '''ASCII multiplexed''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Multiplexed_file_format|ASCII multiplexed format]] for a description of the data format. If the type of data to export is '''Epochs''' '''around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
* '''ASCII vectorized''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.avr'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Vectorized_file_format|ASCII vectorized format]] for a description of the data format. If the type of data to export is '''Epochs around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc. The data are not average referenced before saving. They will only be average referenced if the data are exported using an average referenced '''Current montage'''. You are only allowed to export small segments in vectorized format. If you have selected '''Continuous data''', this item will be disabled if the data are longer than 20 s in duration.&lt;br /&gt;
&lt;br /&gt;
* '''European Data Format (EDF+)''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.edf'''&amp;lt;/span&amp;gt;&amp;quot;. Export of '''Epochs around triggers''' to EDF+ is currently not possible.&lt;br /&gt;
&lt;br /&gt;
* '''Simple binary matrix''': Data are written to a floating point binary matrix with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.dat'''&amp;lt;/span&amp;gt;&amp;quot;. The matrix has the dimension no of samples x no of channels. In addition, a header file with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.generic'''&amp;lt;/span&amp;gt;&amp;quot; is also written. The header file is a text file contains information about the number of channels, sampling rate, and number of samples. These follow the specifications of the Generic File Format. This data format can be useful as a means of transferring data to other programs (e.g. '''MATLAB''') in a relatively compact form. If the type of data to export is '''Epochs around triggers''', the epochs are concatenated in the same target file. In this case, the header file contains a line specifying the number of epochs (cf. ''Generic File Format''). The number of samples in each epoch is the total number of samples, divided by the number of epochs.&lt;br /&gt;
&lt;br /&gt;
* '''Send To MATLAB''': The data are exported directly to MATLAB into the struct variable &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt;. For more information on the data transfer from BESA Research to MATLAB, please refer to the Help chapter [[MATLAB_Interface | MATLAB interface]].&lt;br /&gt;
&lt;br /&gt;
== Resampling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check '''Resample data''' to change the sampling rate of the target data. The edit box is enabled, and you specify a sampling rate.&lt;br /&gt;
&lt;br /&gt;
Data are resampled using splines. Thus, the new sampling rate is not limited to fractions or multiples of the original rate.&lt;br /&gt;
&lt;br /&gt;
Note that if '''Resample data''' is not checked, the sampling rate of the source data is displayed.&lt;br /&gt;
&lt;br /&gt;
'''Resampling and aliasing'''. If you want to reduce the sampling rate it is important to avoid aliasing! It is recommended that a low-pass filter with a boundary frequency of not more than 1/3 of the original sampling rate is used. When you set a new sampling rate, BESA Research checks the current filter settings. If export without filters is selected, or if the current low-pass filter is set to a value that is higher than 1/3 of the sampling rate, BESA Research sets the filter, and opens a message box with a warning:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You may adjust the filters by pressing the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Filter'''&amp;lt;/span&amp;gt; button, e.g. if the original data were already recorded with a sufficiently low low-pass filter setting, so that additional filtering is unnecessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Compression ==&lt;br /&gt;
&lt;br /&gt;
When exporting to BESA binary format and ASCII multiplex formats, you can compress the data to save space. Here we describe properties and pitfalls of the compression algorithm.&lt;br /&gt;
&lt;br /&gt;
=== Compression of BESA binary data ===&lt;br /&gt;
&lt;br /&gt;
'''How compression works'''&lt;br /&gt;
&lt;br /&gt;
The compression algorithm works on two principals:&lt;br /&gt;
* '''Data resolution can often be reduced without losing data quality.''' For instance, a data resolution of 0.1 µV or higher is unnecessary for viewing normal EEG -- 0.5 µV or 1 µV steps are sufficient. Similarly for event-related potentials: the raw data only require a resolution of 0.5 µV or 1 µV to achieve a much higher resolution after averaging.&lt;br /&gt;
* '''Differences between successive data samples''' on a signal are generally much smaller than '''the absolute values of the data'''. Thus, one start value, and then a series of subsequent differences can be stored in a much smaller space than an equivalent series of absolute values. A consequence of this principle is that smoothed signals (with high frequencies removed) can be compressed into a smaller space than signals with a lot of high frequency noise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Compression parameter'''&lt;br /&gt;
&lt;br /&gt;
The parameter you need to choose is the data resolution, or step size. Steps smaller than this size will no longer be represented in the compressed data. The BESA Research Export Module allows the following steps for the compression of EEG signals:&lt;br /&gt;
&lt;br /&gt;
0.1 µV, 0.2 µV, 0.5 µV, 1 µV&lt;br /&gt;
&lt;br /&gt;
For raw EEG data, we recommend using a step size of 0.5 µV.&lt;br /&gt;
&lt;br /&gt;
'''Different compression parameters for different data types (pitfalls!)'''&lt;br /&gt;
&lt;br /&gt;
As described above, the step sizes make sense for EEG signals. For other types of data, other step sizes make more sense. In addition, a polygraphic signal can have the same order of signal magnitude as the EEG (e.g. an EOG or EKG signal), but it might have a completely different scale, e.g. a voice signal, recorded in mV or V. To help accommodate different orders of signal magnitude, BESA Research applies the following rules:&lt;br /&gt;
* '''MEG data:''' Step sizes (in units of fT) are 20 x the step size in µV. Thus, a step size of 0.5 µV will lead to a step size of 10 fT for MEG data.&lt;br /&gt;
* '''Polygraphic and ICR data''': The step size depends on the current amplitude scaling factor in BESA Research. A multiplication factor is used that is the current scaling factor, divided by 100. Thus, if the scale is set to 1 V, the factor is 10 mV. If you have chosen an EEG step size of 0.5 µV, the resulting step size will be 10 x 0.5 = 5 mV.&lt;br /&gt;
&lt;br /&gt;
A pitfall in compression is that if the current amplitude scaling for polygraphic or ICR data does not display the signal sensibly, compression may lead to complete loss of the signal. Note that this only applies to polygraphic and ICR channel types.&lt;br /&gt;
&lt;br /&gt;
* '''Averages:''' We recommend that averaged ERPs are not compressed. Since the signals are generally much smaller than the raw data, compression will lead to unacceptable loss of data resolution.&lt;br /&gt;
&lt;br /&gt;
=== Compression of ASCII multiplexed data ===&lt;br /&gt;
&lt;br /&gt;
When compression is specified, data are written as integer values, and the scaling is specified in the header line of the *.mul file as ''Bins/uV=xxx''. &lt;br /&gt;
&lt;br /&gt;
With no compression, the header contains ''Bins/uV=1.0'', and the data are written with 7 characters per number (e.g. -4.5084, 2.57239).&lt;br /&gt;
&lt;br /&gt;
With compression, the data are written as integers, e.g. 0 -10 -6 -4, which can lead to considerably less characters and thus&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! No compression&lt;br /&gt;
! 0.1&lt;br /&gt;
! 0.2&lt;br /&gt;
! 0.5&lt;br /&gt;
! 1.0&lt;br /&gt;
|-&lt;br /&gt;
| -4.5084&lt;br /&gt;
| -4.5 (-45)&lt;br /&gt;
| -4.6 (-23)&lt;br /&gt;
| -4.5 (-9)&lt;br /&gt;
| -5.0 (-5)&lt;br /&gt;
|-&lt;br /&gt;
| 2.57239&lt;br /&gt;
| 2.6 (26)&lt;br /&gt;
| 2.6 (13)&lt;br /&gt;
| 2.5 (5)&lt;br /&gt;
| 3.0 (3)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The numbers in brackets are the values written to the data file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export</id>
		<title>Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export"/>
				<updated>2021-05-05T14:30:10Z</updated>
		
		<summary type="html">&lt;p&gt;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;
== Exporting files from BESA ==&lt;br /&gt;
&lt;br /&gt;
Data can be exported from BESA Research in the following formats:&lt;br /&gt;
* BESA's own binary format (compressed or uncompressed)&lt;br /&gt;
* ASCII multiplexed&lt;br /&gt;
* ASCII vectorized (short files only)&lt;br /&gt;
* EDF+&lt;br /&gt;
* Simple floating point matrix (e.g. for exporting data to Matlab)&lt;br /&gt;
* Send the data directly to Matlab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can export&lt;br /&gt;
* The entire data set or between markers&lt;br /&gt;
* The currently marked segment&lt;br /&gt;
* Epochs around triggers&lt;br /&gt;
* Standard deviations from binary average files (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''*.fsg'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Export is allowed to various montages:&lt;br /&gt;
* filtered or unfiltered data&lt;br /&gt;
* original data&lt;br /&gt;
* current montage (including artifact correction if applied)&lt;br /&gt;
* standard 81-electrode montage.&lt;br /&gt;
&lt;br /&gt;
On export, you can choose to change the sampling rate.&lt;br /&gt;
&lt;br /&gt;
If exporting to BESA's binary format, you can optionally append the data to a preexisting data set, if sampling rates and the number of channels match. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start export you have to:&lt;br /&gt;
* select File / Export...&lt;br /&gt;
* press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS '''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
* for Send to Matlab only: select File / Send To MATLAB... This also opens the Export Dialog, but only the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Send To Matlab radio'''&amp;lt;/span&amp;gt; button is enabled as target format in the dialog.&lt;br /&gt;
&lt;br /&gt;
== Export Dialog ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The dialog is started when you select'' File / Export...'' or press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS'''&amp;lt;/span&amp;gt; button or select '''Write Segment''' in the right click context menu when a segment has been highlighted.&lt;br /&gt;
&lt;br /&gt;
The dialog is divided into four sections:&lt;br /&gt;
* ''Data to export''. Describes which data are to be exported.&lt;br /&gt;
* ''Montage and Filters.'' Which montage is to be exported, and whether or not filters are used.&lt;br /&gt;
* ''Target data formats''. Specify the format of the exported data.&lt;br /&gt;
* ''Resampling.'' Specify a new sampling rate in the exported data.&lt;br /&gt;
&lt;br /&gt;
''Anonymize using target file name'': Export can be performed either with or without anonymizing using the checkbox &amp;quot;Anonymize using target file name&amp;quot;. When the checkbox is checked, the subject name is replaced by a target file name, and the subject birth date is replaced by 1st July of the subject birth year.&lt;br /&gt;
&lt;br /&gt;
== Type of data to export ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (2).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The types of data to export are:&lt;br /&gt;
* '''Continuous data'''. The whole data set or the data between markers are exported.&lt;br /&gt;
* '''Marked segment.''' If a segment of data is highlighted, this radio button is enabled. Select Marked segment to export just this segment.&lt;br /&gt;
* '''Epochs around triggers.''' Export data segments around triggers. If this item is selected, the two buttons &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Interval'''&amp;lt;/span&amp;gt;... and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Triggers'''&amp;lt;/span&amp;gt;... are enabled. They allow to select the interval (cf ''Edit / Default'' ''Block Epoch''...), and choose among the available triggers (see ''Edit / Trigger Values''...). Note that the default block epoch values are persistent across BESA Research sessions. The trigger selection is not persistent!&lt;br /&gt;
* '''Standard Deviations (from fsg file only).''' If the average file was generated using the BESA Research ERP module, standard deviations are saved in the file. Check this item to export these values to an ASCII file.&lt;br /&gt;
&lt;br /&gt;
'''Between markers.''' If there are markers in the file, and '''Marked segment''' is not selected, selecting '''Between markers''' will result in the export of data between markers relative to the current position in the file (as defined by the middle of the current display), either:&lt;br /&gt;
* if there is no previous marker, from the beginning of the file to the next marker, or&lt;br /&gt;
* from the previous to the next marker, or&lt;br /&gt;
* if there is no next marker, from the previous marker to the end of the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Montages and Filters ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The data can be exported either&lt;br /&gt;
&lt;br /&gt;
* '''Original data.''' The data are exported using the original montage&lt;br /&gt;
&lt;br /&gt;
* '''Current montage.''' The currently selected montage is exported. If extra channels, e.g. selected channels or artifact waveforms are displayed, these are exported as well. Notes:&lt;br /&gt;
** When 'Current Montage' is selected, no auxiliary files are exported. When re-importing the data into BESA Research, all channels will be defined as polygraphic.&lt;br /&gt;
** If the current data is artifact-corrected, the artifact-corrected data will be exported when 'Current Montage' is selected.&lt;br /&gt;
&lt;br /&gt;
* '''Standard 81 electrode locations.''' EEG data are interpolated to a set of 81 electrodes on a standard head (average over 24 mainly Caucasian heads).&lt;br /&gt;
&lt;br /&gt;
* Export can be performed either with or without the currently selected filters. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Filters'''&amp;lt;/span&amp;gt;... button to change the current filter settings (see also ''Filters / Edit Filter Settings''...). Note that if artifact correction was performed and this checkbox is enabled, data will be exported with artifact correction. &lt;br /&gt;
&lt;br /&gt;
== Target Data Formats ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (4).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following target formats are available:&lt;br /&gt;
&lt;br /&gt;
* '''BESA binary''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt;&amp;quot; or &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.fsg'''&amp;lt;/span&amp;gt;&amp;quot;. You can select whether to export with no compression (recommended for averages), or compressed (recommended for raw data). Note that compression can result in loss of resolution in averaged data. See [[Export#Data_Compression|Data Compression]].&lt;br /&gt;
&lt;br /&gt;
* '''ASCII multiplexed''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Multiplexed_file_format|ASCII multiplexed format]] for a description of the data format. If the type of data to export is '''Epochs''' '''around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
* '''ASCII vectorized''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.avr'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Vectorized_file_format|ASCII vectorized format]] for a description of the data format. If the type of data to export is '''Epochs around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc. The data are not average referenced before saving. They will only be average referenced if the data are exported using an average referenced '''Current montage'''. You are only allowed to export small segments in vectorized format. If you have selected '''Continuous data''', this item will be disabled if the data are longer than 20 s in duration.&lt;br /&gt;
&lt;br /&gt;
* '''European Data Format (EDF+)''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.edf'''&amp;lt;/span&amp;gt;&amp;quot;. Export of '''Epochs around triggers''' to EDF+ is currently not possible.&lt;br /&gt;
&lt;br /&gt;
* '''Simple binary matrix''': Data are written to a floating point binary matrix with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.dat'''&amp;lt;/span&amp;gt;&amp;quot;. The matrix has the dimension no of samples x no of channels. In addition, a header file with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.generic'''&amp;lt;/span&amp;gt;&amp;quot; is also written. The header file is a text file contains information about the number of channels, sampling rate, and number of samples. These follow the specifications of the Generic File Format that can also be read by BESA Research if the Generic Reader is installed. This data format can be useful as a means of transferring data to other programs (e.g. '''MATLAB''') in a relatively compact form. If the type of data to export is '''Epochs around triggers''', the epochs are concatenated in the same target file. In this case, the header file contains a line specifying the number of epochs (cf. ''Generic File Format''). The number of samples in each epoch is the total number of samples, divided by the number of epochs.&lt;br /&gt;
&lt;br /&gt;
* '''Send To MATLAB''': The data are exported directly to MATLAB into the struct variable &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt;. For more information on the data transfer from BESA Research to MATLAB, please refer to the Help chapter [[MATLAB_Interface | MATLAB interface]].&lt;br /&gt;
&lt;br /&gt;
== Resampling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check '''Resample data''' to change the sampling rate of the target data. The edit box is enabled, and you specify a sampling rate.&lt;br /&gt;
&lt;br /&gt;
Data are resampled using splines. Thus, the new sampling rate is not limited to fractions or multiples of the original rate.&lt;br /&gt;
&lt;br /&gt;
Note that if '''Resample data''' is not checked, the sampling rate of the source data is displayed.&lt;br /&gt;
&lt;br /&gt;
'''Resampling and aliasing'''. If you want to reduce the sampling rate it is important to avoid aliasing! It is recommended that a low-pass filter with a boundary frequency of not more than 1/3 of the original sampling rate is used. When you set a new sampling rate, BESA Research checks the current filter settings. If export without filters is selected, or if the current low-pass filter is set to a value that is higher than 1/3 of the sampling rate, BESA Research sets the filter, and opens a message box with a warning:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You may adjust the filters by pressing the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Filter'''&amp;lt;/span&amp;gt; button, e.g. if the original data were already recorded with a sufficiently low low-pass filter setting, so that additional filtering is unnecessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Compression ==&lt;br /&gt;
&lt;br /&gt;
When exporting to BESA binary format and ASCII multiplex formats, you can compress the data to save space. Here we describe properties and pitfalls of the compression algorithm.&lt;br /&gt;
&lt;br /&gt;
=== Compression of BESA binary data ===&lt;br /&gt;
&lt;br /&gt;
'''How compression works'''&lt;br /&gt;
&lt;br /&gt;
The compression algorithm works on two principals:&lt;br /&gt;
* '''Data resolution can often be reduced without losing data quality.''' For instance, a data resolution of 0.1 µV or higher is unnecessary for viewing normal EEG -- 0.5 µV or 1 µV steps are sufficient. Similarly for event-related potentials: the raw data only require a resolution of 0.5 µV or 1 µV to achieve a much higher resolution after averaging.&lt;br /&gt;
* '''Differences between successive data samples''' on a signal are generally much smaller than '''the absolute values of the data'''. Thus, one start value, and then a series of subsequent differences can be stored in a much smaller space than an equivalent series of absolute values. A consequence of this principle is that smoothed signals (with high frequencies removed) can be compressed into a smaller space than signals with a lot of high frequency noise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Compression parameter'''&lt;br /&gt;
&lt;br /&gt;
The parameter you need to choose is the data resolution, or step size. Steps smaller than this size will no longer be represented in the compressed data. The BESA Research Export Module allows the following steps for the compression of EEG signals:&lt;br /&gt;
&lt;br /&gt;
0.1 µV, 0.2 µV, 0.5 µV, 1 µV&lt;br /&gt;
&lt;br /&gt;
For raw EEG data, we recommend using a step size of 0.5 µV.&lt;br /&gt;
&lt;br /&gt;
'''Different compression parameters for different data types (pitfalls!)'''&lt;br /&gt;
&lt;br /&gt;
As described above, the step sizes make sense for EEG signals. For other types of data, other step sizes make more sense. In addition, a polygraphic signal can have the same order of signal magnitude as the EEG (e.g. an EOG or EKG signal), but it might have a completely different scale, e.g. a voice signal, recorded in mV or V. To help accommodate different orders of signal magnitude, BESA Research applies the following rules:&lt;br /&gt;
* '''MEG data:''' Step sizes (in units of fT) are 20 x the step size in µV. Thus, a step size of 0.5 µV will lead to a step size of 10 fT for MEG data.&lt;br /&gt;
* '''Polygraphic and ICR data''': The step size depends on the current amplitude scaling factor in BESA Research. A multiplication factor is used that is the current scaling factor, divided by 100. Thus, if the scale is set to 1 V, the factor is 10 mV. If you have chosen an EEG step size of 0.5 µV, the resulting step size will be 10 x 0.5 = 5 mV.&lt;br /&gt;
&lt;br /&gt;
A pitfall in compression is that if the current amplitude scaling for polygraphic or ICR data does not display the signal sensibly, compression may lead to complete loss of the signal. Note that this only applies to polygraphic and ICR channel types.&lt;br /&gt;
&lt;br /&gt;
* '''Averages:''' We recommend that averaged ERPs are not compressed. Since the signals are generally much smaller than the raw data, compression will lead to unacceptable loss of data resolution.&lt;br /&gt;
&lt;br /&gt;
=== Compression of ASCII multiplexed data ===&lt;br /&gt;
&lt;br /&gt;
When compression is specified, data are written as integer values, and the scaling is specified in the header line of the *.mul file as ''Bins/uV=xxx''. &lt;br /&gt;
&lt;br /&gt;
With no compression, the header contains ''Bins/uV=1.0'', and the data are written with 7 characters per number (e.g. -4.5084, 2.57239).&lt;br /&gt;
&lt;br /&gt;
With compression, the data are written as integers, e.g. 0 -10 -6 -4, which can lead to considerably less characters and thus&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! No compression&lt;br /&gt;
! 0.1&lt;br /&gt;
! 0.2&lt;br /&gt;
! 0.5&lt;br /&gt;
! 1.0&lt;br /&gt;
|-&lt;br /&gt;
| -4.5084&lt;br /&gt;
| -4.5 (-45)&lt;br /&gt;
| -4.6 (-23)&lt;br /&gt;
| -4.5 (-9)&lt;br /&gt;
| -5.0 (-5)&lt;br /&gt;
|-&lt;br /&gt;
| 2.57239&lt;br /&gt;
| 2.6 (26)&lt;br /&gt;
| 2.6 (13)&lt;br /&gt;
| 2.5 (5)&lt;br /&gt;
| 3.0 (3)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The numbers in brackets are the values written to the data file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export</id>
		<title>Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export"/>
				<updated>2021-05-05T14:26:13Z</updated>
		
		<summary type="html">&lt;p&gt;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;
== Exporting files from BESA ==&lt;br /&gt;
&lt;br /&gt;
Data can be exported from BESA Research in the following formats:&lt;br /&gt;
* BESA's own binary format (compressed or uncompressed)&lt;br /&gt;
* ASCII multiplexed&lt;br /&gt;
* ASCII vectorized (short files only)&lt;br /&gt;
* EDF+&lt;br /&gt;
* Simple floating point matrix (e.g. for exporting data to Matlab)&lt;br /&gt;
* Send the data directly to Matlab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can export&lt;br /&gt;
* The entire data set or between markers&lt;br /&gt;
* The currently marked segment&lt;br /&gt;
* Epochs around triggers&lt;br /&gt;
* Standard deviations from binary average files (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''*.fsg'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Export is allowed to various montages:&lt;br /&gt;
* filtered or unfiltered data&lt;br /&gt;
* original data&lt;br /&gt;
* current montage (including artifact correction if applied)&lt;br /&gt;
* standard 81-electrode montage.&lt;br /&gt;
&lt;br /&gt;
On export, you can choose to change the sampling rate.&lt;br /&gt;
&lt;br /&gt;
If exporting to BESA's binary format, you can optionally append the data to a preexisting data set, if sampling rates and the number of channels match. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start export you have to:&lt;br /&gt;
* select File / Export...&lt;br /&gt;
* press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS '''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
* for Send to Matlab only: select File / Send To MATLAB... This also opens the Export Dialog, but only the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Send To Matlab radio'''&amp;lt;/span&amp;gt; button is enabled as target format in the dialog.&lt;br /&gt;
&lt;br /&gt;
== Export Dialog ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The dialog is started when you select'' File / Export...'' or press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS'''&amp;lt;/span&amp;gt; button or select '''Write Segment''' in the right click context menu when a segment has been highlighted.&lt;br /&gt;
&lt;br /&gt;
The dialog is divided into four sections:&lt;br /&gt;
* ''Data to export''. Describes which data are to be exported.&lt;br /&gt;
* ''Montage and Filters.'' Which montage is to be exported, and whether or not filters are used.&lt;br /&gt;
* ''Target data formats''. Specify the format of the exported data.&lt;br /&gt;
* ''Resampling.'' Specify a new sampling rate in the exported data.&lt;br /&gt;
&lt;br /&gt;
''Anonymize using target file name'': Export can be performed either with or without anonymizing using the checkbox &amp;quot;Anonymize using target file name&amp;quot;. When the checkbox is checked, the subject name is replaced by a target file name, and the subject birth date is replaced by 1st July of the subject birth year.&lt;br /&gt;
&lt;br /&gt;
== Type of data to export ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (2).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The types of data to export are:&lt;br /&gt;
* '''Continuous data'''. The whole data set or the data between markers are exported.&lt;br /&gt;
* '''Marked segment.''' If a segment of data is highlighted, this radio button is enabled. Select Marked segment to export just this segment.&lt;br /&gt;
* '''Epochs around triggers.''' Export data segments around triggers. If this item is selected, the two buttons &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Interval'''&amp;lt;/span&amp;gt;... and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Triggers'''&amp;lt;/span&amp;gt;... are enabled. They allow to select the interval (cf ''Edit / Default'' ''Block Epoch''...), and choose among the available triggers (see ''Edit / Trigger Values''...). Note that the default block epoch values are persistent across BESA Research sessions. The trigger selection is not persistent!&lt;br /&gt;
* '''Standard Deviations (from fsg file only).''' If the average file was generated using the BESA Research ERP module, standard deviations are saved in the file. Check this item to export these values to an ASCII file.&lt;br /&gt;
&lt;br /&gt;
'''Between markers.''' If there are markers in the file, and '''Marked segment''' is not selected, selecting '''Between markers''' will result in the export of data between markers relative to the current position in the file (as defined by the middle of the current display), either:&lt;br /&gt;
* if there is no previous marker, from the beginning of the file to the next marker, or&lt;br /&gt;
* from the previous to the next marker, or&lt;br /&gt;
* if there is no next marker, from the previous marker to the end of the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Montages and Filters ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The data can be exported either&lt;br /&gt;
&lt;br /&gt;
* '''Original data.''' The data are exported using the original montage&lt;br /&gt;
&lt;br /&gt;
* '''Current montage.''' The currently selected montage is exported. If extra channels, e.g. selected channels or artifact waveforms are displayed, these are exported as well. Notes:&lt;br /&gt;
** When 'Current Montage' is selected, no auxiliary files are exported. When re-importing the data into BESA Research, all channels will be defined as polygraphic.&lt;br /&gt;
** If the current data is artifact-corrected, the artifact-corrected data will be exported when 'Current Montage' is selected.&lt;br /&gt;
&lt;br /&gt;
* '''Standard 81 electrode locations.''' EEG data are interpolated to a set of 81 electrodes on a standard head (average over 24 mainly Caucasian heads).&lt;br /&gt;
&lt;br /&gt;
* Export can be performed either with or without the currently selected filters. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Filters'''&amp;lt;/span&amp;gt;... button to change the current filter settings (see also ''Filters / Edit Filter Settings''...).&lt;br /&gt;
&lt;br /&gt;
== Target Data Formats ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (4).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following target formats are available:&lt;br /&gt;
&lt;br /&gt;
* '''BESA binary''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt;&amp;quot; or &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.fsg'''&amp;lt;/span&amp;gt;&amp;quot;. You can select whether to export with no compression (recommended for averages), or compressed (recommended for raw data). Note that compression can result in loss of resolution in averaged data. See [[Export#Data_Compression|Data Compression]].&lt;br /&gt;
&lt;br /&gt;
* '''ASCII multiplexed''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Multiplexed_file_format|ASCII multiplexed format]] for a description of the data format. If the type of data to export is '''Epochs''' '''around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
* '''ASCII vectorized''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.avr'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Vectorized_file_format|ASCII vectorized format]] for a description of the data format. If the type of data to export is '''Epochs around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc. The data are not average referenced before saving. They will only be average referenced if the data are exported using an average referenced '''Current montage'''. You are only allowed to export small segments in vectorized format. If you have selected '''Continuous data''', this item will be disabled if the data are longer than 20 s in duration.&lt;br /&gt;
&lt;br /&gt;
* '''European Data Format (EDF+)''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.edf'''&amp;lt;/span&amp;gt;&amp;quot;. Export of '''Epochs around triggers''' to EDF+ is currently not possible.&lt;br /&gt;
&lt;br /&gt;
* '''Simple binary matrix''': Data are written to a floating point binary matrix with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.dat'''&amp;lt;/span&amp;gt;&amp;quot;. The matrix has the dimension no of samples x no of channels. In addition, a header file with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.generic'''&amp;lt;/span&amp;gt;&amp;quot; is also written. The header file is a text file contains information about the number of channels, sampling rate, and number of samples. These follow the specifications of the Generic File Format that can also be read by BESA Research if the Generic Reader is installed. This data format can be useful as a means of transferring data to other programs (e.g. '''MATLAB''') in a relatively compact form. If the type of data to export is '''Epochs around triggers''', the epochs are concatenated in the same target file. In this case, the header file contains a line specifying the number of epochs (cf. ''Generic File Format''). The number of samples in each epoch is the total number of samples, divided by the number of epochs.&lt;br /&gt;
&lt;br /&gt;
* '''Send To MATLAB''': The data are exported directly to MATLAB into the struct variable &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt;. For more information on the data transfer from BESA Research to MATLAB, please refer to the Help chapter [[MATLAB_Interface | MATLAB interface]].&lt;br /&gt;
&lt;br /&gt;
== Resampling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check '''Resample data''' to change the sampling rate of the target data. The edit box is enabled, and you specify a sampling rate.&lt;br /&gt;
&lt;br /&gt;
Data are resampled using splines. Thus, the new sampling rate is not limited to fractions or multiples of the original rate.&lt;br /&gt;
&lt;br /&gt;
Note that if '''Resample data''' is not checked, the sampling rate of the source data is displayed.&lt;br /&gt;
&lt;br /&gt;
'''Resampling and aliasing'''. If you want to reduce the sampling rate it is important to avoid aliasing! It is recommended that a low-pass filter with a boundary frequency of not more than 1/3 of the original sampling rate is used. When you set a new sampling rate, BESA Research checks the current filter settings. If export without filters is selected, or if the current low-pass filter is set to a value that is higher than 1/3 of the sampling rate, BESA Research sets the filter, and opens a message box with a warning:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You may adjust the filters by pressing the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Filter'''&amp;lt;/span&amp;gt; button, e.g. if the original data were already recorded with a sufficiently low low-pass filter setting, so that additional filtering is unnecessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Compression ==&lt;br /&gt;
&lt;br /&gt;
When exporting to BESA binary format and ASCII multiplex formats, you can compress the data to save space. Here we describe properties and pitfalls of the compression algorithm.&lt;br /&gt;
&lt;br /&gt;
=== Compression of BESA binary data ===&lt;br /&gt;
&lt;br /&gt;
'''How compression works'''&lt;br /&gt;
&lt;br /&gt;
The compression algorithm works on two principals:&lt;br /&gt;
* '''Data resolution can often be reduced without losing data quality.''' For instance, a data resolution of 0.1 µV or higher is unnecessary for viewing normal EEG -- 0.5 µV or 1 µV steps are sufficient. Similarly for event-related potentials: the raw data only require a resolution of 0.5 µV or 1 µV to achieve a much higher resolution after averaging.&lt;br /&gt;
* '''Differences between successive data samples''' on a signal are generally much smaller than '''the absolute values of the data'''. Thus, one start value, and then a series of subsequent differences can be stored in a much smaller space than an equivalent series of absolute values. A consequence of this principle is that smoothed signals (with high frequencies removed) can be compressed into a smaller space than signals with a lot of high frequency noise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Compression parameter'''&lt;br /&gt;
&lt;br /&gt;
The parameter you need to choose is the data resolution, or step size. Steps smaller than this size will no longer be represented in the compressed data. The BESA Research Export Module allows the following steps for the compression of EEG signals:&lt;br /&gt;
&lt;br /&gt;
0.1 µV, 0.2 µV, 0.5 µV, 1 µV&lt;br /&gt;
&lt;br /&gt;
For raw EEG data, we recommend using a step size of 0.5 µV.&lt;br /&gt;
&lt;br /&gt;
'''Different compression parameters for different data types (pitfalls!)'''&lt;br /&gt;
&lt;br /&gt;
As described above, the step sizes make sense for EEG signals. For other types of data, other step sizes make more sense. In addition, a polygraphic signal can have the same order of signal magnitude as the EEG (e.g. an EOG or EKG signal), but it might have a completely different scale, e.g. a voice signal, recorded in mV or V. To help accommodate different orders of signal magnitude, BESA Research applies the following rules:&lt;br /&gt;
* '''MEG data:''' Step sizes (in units of fT) are 20 x the step size in µV. Thus, a step size of 0.5 µV will lead to a step size of 10 fT for MEG data.&lt;br /&gt;
* '''Polygraphic and ICR data''': The step size depends on the current amplitude scaling factor in BESA Research. A multiplication factor is used that is the current scaling factor, divided by 100. Thus, if the scale is set to 1 V, the factor is 10 mV. If you have chosen an EEG step size of 0.5 µV, the resulting step size will be 10 x 0.5 = 5 mV.&lt;br /&gt;
&lt;br /&gt;
A pitfall in compression is that if the current amplitude scaling for polygraphic or ICR data does not display the signal sensibly, compression may lead to complete loss of the signal. Note that this only applies to polygraphic and ICR channel types.&lt;br /&gt;
&lt;br /&gt;
* '''Averages:''' We recommend that averaged ERPs are not compressed. Since the signals are generally much smaller than the raw data, compression will lead to unacceptable loss of data resolution.&lt;br /&gt;
&lt;br /&gt;
=== Compression of ASCII multiplexed data ===&lt;br /&gt;
&lt;br /&gt;
When compression is specified, data are written as integer values, and the scaling is specified in the header line of the *.mul file as ''Bins/uV=xxx''. &lt;br /&gt;
&lt;br /&gt;
With no compression, the header contains ''Bins/uV=1.0'', and the data are written with 7 characters per number (e.g. -4.5084, 2.57239).&lt;br /&gt;
&lt;br /&gt;
With compression, the data are written as integers, e.g. 0 -10 -6 -4, which can lead to considerably less characters and thus&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! No compression&lt;br /&gt;
! 0.1&lt;br /&gt;
! 0.2&lt;br /&gt;
! 0.5&lt;br /&gt;
! 1.0&lt;br /&gt;
|-&lt;br /&gt;
| -4.5084&lt;br /&gt;
| -4.5 (-45)&lt;br /&gt;
| -4.6 (-23)&lt;br /&gt;
| -4.5 (-9)&lt;br /&gt;
| -5.0 (-5)&lt;br /&gt;
|-&lt;br /&gt;
| 2.57239&lt;br /&gt;
| 2.6 (26)&lt;br /&gt;
| 2.6 (13)&lt;br /&gt;
| 2.5 (5)&lt;br /&gt;
| 3.0 (3)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The numbers in brackets are the values written to the data file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export</id>
		<title>Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export"/>
				<updated>2021-05-05T14:17:30Z</updated>
		
		<summary type="html">&lt;p&gt;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;
== Exporting files from BESA ==&lt;br /&gt;
&lt;br /&gt;
Data can be exported from BESA Research in the following formats:&lt;br /&gt;
* BESA's own binary format (compressed or uncompressed)&lt;br /&gt;
* ASCII multiplexed&lt;br /&gt;
* ASCII vectorized (short files only)&lt;br /&gt;
* EDF+&lt;br /&gt;
* Simple floating point matrix (e.g. for exporting data to Matlab)&lt;br /&gt;
* Send the data directly to Matlab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can export&lt;br /&gt;
* The entire data set or between markers&lt;br /&gt;
* The currently marked segment&lt;br /&gt;
* Epochs around triggers&lt;br /&gt;
* Standard deviations from binary average files (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''*.fsg'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Export is allowed to various montages:&lt;br /&gt;
* filtered or unfiltered data&lt;br /&gt;
* original data&lt;br /&gt;
* current montage (including artifact correction if applied)&lt;br /&gt;
* standard 81-electrode montage.&lt;br /&gt;
&lt;br /&gt;
On export, you can choose to change the sampling rate.&lt;br /&gt;
&lt;br /&gt;
If exporting to BESA's binary format, you can optionally append the data to a preexisting data set, if sampling rates and the number of channels match. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start export you have to:&lt;br /&gt;
* select File / Export...&lt;br /&gt;
* press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS '''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
* for Send to Matlab only: select File / Send To MATLAB... This also opens the Export Dialog, but only the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Send To Matlab radio'''&amp;lt;/span&amp;gt; button is enabled as target format in the dialog.&lt;br /&gt;
&lt;br /&gt;
== Export Dialog ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The dialog is started when you select'' File / Export...'' or press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS'''&amp;lt;/span&amp;gt; button or select '''Write Segment''' in the right click context menu when a segment has been highlighted.&lt;br /&gt;
&lt;br /&gt;
The dialog is divided into four sections. Please read the following chapters for more details:&lt;br /&gt;
* ''Data to export''. Describes which data are to be exported.&lt;br /&gt;
* ''Montage and Filters.'' Which montage is to be exported, and whether or not filters are used.&lt;br /&gt;
* ''Target data formats''. Specify the format of the exported data.&lt;br /&gt;
* ''Resampling.'' Specify a new sampling rate in the exported data.&lt;br /&gt;
&lt;br /&gt;
''Anonymize using target file name'': Export can be performed either with or without anonymizing using the checkbox &amp;quot;Anonymize using target file name&amp;quot;. When the checkbox is checked, the subject name is replaced by a target file name, and the subject birth date is replaced by 1st July of the subject birth year.&lt;br /&gt;
&lt;br /&gt;
== Type of data to export ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (2).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The types of data to export are:&lt;br /&gt;
* '''Continuous data'''. The whole data set or the data between markers are exported.&lt;br /&gt;
* '''Marked segment.''' If a segment of data is highlighted, this radio button is enabled. Select Marked segment to export just this segment.&lt;br /&gt;
* '''Epochs around triggers.''' Export data segments around triggers. If this item is selected, the two buttons &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Interval'''&amp;lt;/span&amp;gt;... and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Triggers'''&amp;lt;/span&amp;gt;... are enabled. They allow to select the interval (cf ''Edit / Default'' ''Block Epoch''...), and choose among the available triggers (see ''Edit / Trigger Values''...). Note that the default block epoch values are persistent across BESA Research sessions. The trigger selection is not persistent!&lt;br /&gt;
* '''Standard Deviations (from fsg file only).''' If the average file was generated using the BESA Research ERP module, standard deviations are saved in the file. Check this item to export these values to an ASCII file.&lt;br /&gt;
&lt;br /&gt;
'''Between markers.''' If there are markers in the file, and '''Marked segment''' is not selected, selecting '''Between markers''' will result in the export of data between markers relative to the current position in the file (as defined by the middle of the current display), either:&lt;br /&gt;
* if there is no previous marker, from the beginning of the file to the next marker, or&lt;br /&gt;
* from the previous to the next marker, or&lt;br /&gt;
* if there is no next marker, from the previous marker to the end of the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Montages and Filters ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The data can be exported either&lt;br /&gt;
&lt;br /&gt;
* '''Original data.''' The data are exported using the original montage&lt;br /&gt;
&lt;br /&gt;
* '''Current montage.''' The currently selected montage is exported. If extra channels, e.g. selected channels or artifact waveforms are displayed, these are exported as well. Notes:&lt;br /&gt;
** When 'Current Montage' is selected, no auxiliary files are exported. When re-importing the data into BESA Research, all channels will be defined as polygraphic.&lt;br /&gt;
** If the current data is artifact-corrected, the artifact-corrected data will be exported when 'Current Montage' is selected.&lt;br /&gt;
&lt;br /&gt;
* '''Standard 81 electrode locations.''' EEG data are interpolated to a set of 81 electrodes on a standard head (average over 24 mainly Caucasian heads).&lt;br /&gt;
&lt;br /&gt;
* Export can be performed either with or without the currently selected filters. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Filters'''&amp;lt;/span&amp;gt;... button to change the current filter settings (see also ''Filters / Edit Filter Settings''...).&lt;br /&gt;
&lt;br /&gt;
== Target Data Formats ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (4).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following target formats are available:&lt;br /&gt;
&lt;br /&gt;
* '''BESA binary''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt;&amp;quot; or &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.fsg'''&amp;lt;/span&amp;gt;&amp;quot;. You can select whether to export with no compression (recommended for averages), or compressed (recommended for raw data). Note that compression can result in loss of resolution in averaged data. See [[Export#Data_Compression|Data Compression]].&lt;br /&gt;
&lt;br /&gt;
* '''ASCII multiplexed''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Multiplexed_file_format|ASCII multiplexed format]] for a description of the data format. If the type of data to export is '''Epochs''' '''around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
* '''ASCII vectorized''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.avr'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Vectorized_file_format|ASCII vectorized format]] for a description of the data format. If the type of data to export is '''Epochs around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc. The data are not average referenced before saving. They will only be average referenced if the data are exported using an average referenced '''Current montage'''. You are only allowed to export small segments in vectorized format. If you have selected '''Continuous data''', this item will be disabled if the data are longer than 20 s in duration.&lt;br /&gt;
&lt;br /&gt;
* '''European Data Format (EDF+)''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.edf'''&amp;lt;/span&amp;gt;&amp;quot;. Export of '''Epochs around triggers''' to EDF+ is currently not possible.&lt;br /&gt;
&lt;br /&gt;
* '''Simple binary matrix''': Data are written to a floating point binary matrix with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.dat'''&amp;lt;/span&amp;gt;&amp;quot;. The matrix has the dimension no of samples x no of channels. In addition, a header file with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.generic'''&amp;lt;/span&amp;gt;&amp;quot; is also written. The header file is a text file contains information about the number of channels, sampling rate, and number of samples. These follow the specifications of the Generic File Format that can also be read by BESA Research if the Generic Reader is installed. This data format can be useful as a means of transferring data to other programs (e.g. '''MATLAB''') in a relatively compact form. If the type of data to export is '''Epochs around triggers''', the epochs are concatenated in the same target file. In this case, the header file contains a line specifying the number of epochs (cf. ''Generic File Format''). The number of samples in each epoch is the total number of samples, divided by the number of epochs.&lt;br /&gt;
&lt;br /&gt;
* '''Send To MATLAB''': The data are exported directly to MATLAB into the struct variable &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt;. For more information on the data transfer from BESA Research to MATLAB, please refer to the Help chapter [[MATLAB_Interface | MATLAB interface]].&lt;br /&gt;
&lt;br /&gt;
== Resampling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check '''Resample data''' to change the sampling rate of the target data. The edit box is enabled, and you specify a sampling rate.&lt;br /&gt;
&lt;br /&gt;
Data are resampled using splines. Thus, the new sampling rate is not limited to fractions or multiples of the original rate.&lt;br /&gt;
&lt;br /&gt;
Note that if '''Resample data''' is not checked, the sampling rate of the source data is displayed.&lt;br /&gt;
&lt;br /&gt;
'''Resampling and aliasing'''. If you want to reduce the sampling rate it is important to avoid aliasing! It is recommended that a low-pass filter with a boundary frequency of not more than 1/3 of the original sampling rate is used. When you set a new sampling rate, BESA Research checks the current filter settings. If export without filters is selected, or if the current low-pass filter is set to a value that is higher than 1/3 of the sampling rate, BESA Research sets the filter, and opens a message box with a warning:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You may adjust the filters by pressing the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Filter'''&amp;lt;/span&amp;gt; button, e.g. if the original data were already recorded with a sufficiently low low-pass filter setting, so that additional filtering is unnecessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Compression ==&lt;br /&gt;
&lt;br /&gt;
When exporting to BESA binary format and ASCII multiplex formats, you can compress the data to save space. Here we describe properties and pitfalls of the compression algorithm.&lt;br /&gt;
&lt;br /&gt;
=== Compression of BESA binary data ===&lt;br /&gt;
&lt;br /&gt;
'''How compression works'''&lt;br /&gt;
&lt;br /&gt;
The compression algorithm works on two principals:&lt;br /&gt;
* '''Data resolution can often be reduced without losing data quality.''' For instance, a data resolution of 0.1 µV or higher is unnecessary for viewing normal EEG -- 0.5 µV or 1 µV steps are sufficient. Similarly for event-related potentials: the raw data only require a resolution of 0.5 µV or 1 µV to achieve a much higher resolution after averaging.&lt;br /&gt;
* '''Differences between successive data samples''' on a signal are generally much smaller than '''the absolute values of the data'''. Thus, one start value, and then a series of subsequent differences can be stored in a much smaller space than an equivalent series of absolute values. A consequence of this principle is that smoothed signals (with high frequencies removed) can be compressed into a smaller space than signals with a lot of high frequency noise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Compression parameter'''&lt;br /&gt;
&lt;br /&gt;
The parameter you need to choose is the data resolution, or step size. Steps smaller than this size will no longer be represented in the compressed data. The BESA Research Export Module allows the following steps for the compression of EEG signals:&lt;br /&gt;
&lt;br /&gt;
0.1 µV, 0.2 µV, 0.5 µV, 1 µV&lt;br /&gt;
&lt;br /&gt;
For raw EEG data, we recommend using a step size of 0.5 µV.&lt;br /&gt;
&lt;br /&gt;
'''Different compression parameters for different data types (pitfalls!)'''&lt;br /&gt;
&lt;br /&gt;
As described above, the step sizes make sense for EEG signals. For other types of data, other step sizes make more sense. In addition, a polygraphic signal can have the same order of signal magnitude as the EEG (e.g. an EOG or EKG signal), but it might have a completely different scale, e.g. a voice signal, recorded in mV or V. To help accommodate different orders of signal magnitude, BESA Research applies the following rules:&lt;br /&gt;
* '''MEG data:''' Step sizes (in units of fT) are 20 x the step size in µV. Thus, a step size of 0.5 µV will lead to a step size of 10 fT for MEG data.&lt;br /&gt;
* '''Polygraphic and ICR data''': The step size depends on the current amplitude scaling factor in BESA Research. A multiplication factor is used that is the current scaling factor, divided by 100. Thus, if the scale is set to 1 V, the factor is 10 mV. If you have chosen an EEG step size of 0.5 µV, the resulting step size will be 10 x 0.5 = 5 mV.&lt;br /&gt;
&lt;br /&gt;
A pitfall in compression is that if the current amplitude scaling for polygraphic or ICR data does not display the signal sensibly, compression may lead to complete loss of the signal. Note that this only applies to polygraphic and ICR channel types.&lt;br /&gt;
&lt;br /&gt;
* '''Averages:''' We recommend that averaged ERPs are not compressed. Since the signals are generally much smaller than the raw data, compression will lead to unacceptable loss of data resolution.&lt;br /&gt;
&lt;br /&gt;
=== Compression of ASCII multiplexed data ===&lt;br /&gt;
&lt;br /&gt;
When compression is specified, data are written as integer values, and the scaling is specified in the header line of the *.mul file as ''Bins/uV=xxx''. &lt;br /&gt;
&lt;br /&gt;
With no compression, the header contains ''Bins/uV=1.0'', and the data are written with 7 characters per number (e.g. -4.5084, 2.57239).&lt;br /&gt;
&lt;br /&gt;
With compression, the data are written as integers, e.g. 0 -10 -6 -4, which can lead to considerably less characters and thus&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! No compression&lt;br /&gt;
! 0.1&lt;br /&gt;
! 0.2&lt;br /&gt;
! 0.5&lt;br /&gt;
! 1.0&lt;br /&gt;
|-&lt;br /&gt;
| -4.5084&lt;br /&gt;
| -4.5 (-45)&lt;br /&gt;
| -4.6 (-23)&lt;br /&gt;
| -4.5 (-9)&lt;br /&gt;
| -5.0 (-5)&lt;br /&gt;
|-&lt;br /&gt;
| 2.57239&lt;br /&gt;
| 2.6 (26)&lt;br /&gt;
| 2.6 (13)&lt;br /&gt;
| 2.5 (5)&lt;br /&gt;
| 3.0 (3)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The numbers in brackets are the values written to the data file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Export</id>
		<title>Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Export"/>
				<updated>2021-05-05T14:16:02Z</updated>
		
		<summary type="html">&lt;p&gt;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;
== Exporting files from BESA ==&lt;br /&gt;
&lt;br /&gt;
Data can be exported from BESA Research in the following formats:&lt;br /&gt;
* BESA's own binary format (compressed or uncompressed)&lt;br /&gt;
* ASCII multiplexed&lt;br /&gt;
* ASCII vectorized (short files only)&lt;br /&gt;
* EDF+&lt;br /&gt;
* Simple floating point matrix (e.g. for exporting data to Matlab)&lt;br /&gt;
* Send the data directly to Matlab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can export&lt;br /&gt;
* The entire data set or between markers&lt;br /&gt;
* The currently marked segment&lt;br /&gt;
* Epochs around triggers&lt;br /&gt;
* Standard deviations from binary average files (&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''*.fsg'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Export is allowed to various montages:&lt;br /&gt;
* filtered or unfiltered data&lt;br /&gt;
* original data&lt;br /&gt;
* current montage (including artifact correction if applied)&lt;br /&gt;
* standard 81-electrode montage.&lt;br /&gt;
&lt;br /&gt;
On export, you can choose to change the sampling rate.&lt;br /&gt;
&lt;br /&gt;
If exporting to BESA's binary format, you can optionally append the data to a preexisting data set, if sampling rates and the number of channels match. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Export is started either&lt;br /&gt;
* select File / Export...&lt;br /&gt;
* press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS '''&amp;lt;/span&amp;gt;button.&lt;br /&gt;
* In both cases, you are taken to the ''Export Dialog''.&lt;br /&gt;
* for Send to Matlab only: select File / Send To MATLAB... This also opens the Export Dialog, but only the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Send To Matlab radio'''&amp;lt;/span&amp;gt; button is enabled as target format in the dialog.&lt;br /&gt;
&lt;br /&gt;
== Export Dialog ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The dialog is started when you select'' File / Export...'' or press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''WrS'''&amp;lt;/span&amp;gt; button or select '''Write Segment''' in the right click context menu when a segment has been highlighted.&lt;br /&gt;
&lt;br /&gt;
The dialog is divided into four sections. Please read the following chapters for more details:&lt;br /&gt;
* ''Data to export''. Describes which data are to be exported.&lt;br /&gt;
* ''Montage and Filters.'' Which montage is to be exported, and whether or not filters are used.&lt;br /&gt;
* ''Target data formats''. Specify the format of the exported data.&lt;br /&gt;
* ''Resampling.'' Specify a new sampling rate in the exported data.&lt;br /&gt;
&lt;br /&gt;
''Anonymize using target file name'': Export can be performed either with or without anonymizing using the checkbox &amp;quot;Anonymize using target file name&amp;quot;. When the checkbox is checked, the subject name is replaced by a target file name, and the subject birth date is replaced by 1st July of the subject birth year.&lt;br /&gt;
&lt;br /&gt;
== Type of data to export ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (2).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The types of data to export are:&lt;br /&gt;
* '''Continuous data'''. The whole data set or the data between markers are exported.&lt;br /&gt;
* '''Marked segment.''' If a segment of data is highlighted, this radio button is enabled. Select Marked segment to export just this segment.&lt;br /&gt;
* '''Epochs around triggers.''' Export data segments around triggers. If this item is selected, the two buttons &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Interval'''&amp;lt;/span&amp;gt;... and &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Triggers'''&amp;lt;/span&amp;gt;... are enabled. They allow to select the interval (cf ''Edit / Default'' ''Block Epoch''...), and choose among the available triggers (see ''Edit / Trigger Values''...). Note that the default block epoch values are persistent across BESA Research sessions. The trigger selection is not persistent!&lt;br /&gt;
* '''Standard Deviations (from fsg file only).''' If the average file was generated using the BESA Research ERP module, standard deviations are saved in the file. Check this item to export these values to an ASCII file.&lt;br /&gt;
&lt;br /&gt;
'''Between markers.''' If there are markers in the file, and '''Marked segment''' is not selected, selecting '''Between markers''' will result in the export of data between markers relative to the current position in the file (as defined by the middle of the current display), either:&lt;br /&gt;
* if there is no previous marker, from the beginning of the file to the next marker, or&lt;br /&gt;
* from the previous to the next marker, or&lt;br /&gt;
* if there is no next marker, from the previous marker to the end of the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Montages and Filters ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (3).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The data can be exported either&lt;br /&gt;
&lt;br /&gt;
* '''Original data.''' The data are exported using the original montage&lt;br /&gt;
&lt;br /&gt;
* '''Current montage.''' The currently selected montage is exported. If extra channels, e.g. selected channels or artifact waveforms are displayed, these are exported as well. Notes:&lt;br /&gt;
** When 'Current Montage' is selected, no auxiliary files are exported. When re-importing the data into BESA Research, all channels will be defined as polygraphic.&lt;br /&gt;
** If the current data is artifact-corrected, the artifact-corrected data will be exported when 'Current Montage' is selected.&lt;br /&gt;
&lt;br /&gt;
* '''Standard 81 electrode locations.''' EEG data are interpolated to a set of 81 electrodes on a standard head (average over 24 mainly Caucasian heads).&lt;br /&gt;
&lt;br /&gt;
* Export can be performed either with or without the currently selected filters. Press the &amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;'''Filters'''&amp;lt;/span&amp;gt;... button to change the current filter settings (see also ''Filters / Edit Filter Settings''...).&lt;br /&gt;
&lt;br /&gt;
== Target Data Formats ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (4).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following target formats are available:&lt;br /&gt;
&lt;br /&gt;
* '''BESA binary''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.foc'''&amp;lt;/span&amp;gt;&amp;quot; or &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.fsg'''&amp;lt;/span&amp;gt;&amp;quot;. You can select whether to export with no compression (recommended for averages), or compressed (recommended for raw data). Note that compression can result in loss of resolution in averaged data. See [[Export#Data_Compression|Data Compression]].&lt;br /&gt;
&lt;br /&gt;
* '''ASCII multiplexed''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.mul'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Multiplexed_file_format|ASCII multiplexed format]] for a description of the data format. If the type of data to export is '''Epochs''' '''around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
* '''ASCII vectorized''': Data are normally saved as text with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.avr'''&amp;lt;/span&amp;gt;&amp;quot;. See [[ASCII_File_Format#ASCII_Vectorized_file_format|ASCII vectorized format]] for a description of the data format. If the type of data to export is '''Epochs around triggers''', one file is exported for each trigger, and the file extension is a number, starting with &amp;quot;.000&amp;quot;, and continuing &amp;quot;.001&amp;quot;, &amp;quot;.002&amp;quot;, etc. The data are not average referenced before saving. They will only be average referenced if the data are exported using an average referenced '''Current montage'''. You are only allowed to export small segments in vectorized format. If you have selected '''Continuous data''', this item will be disabled if the data are longer than 20 s in duration.&lt;br /&gt;
&lt;br /&gt;
* '''European Data Format (EDF+)''': Data are saved with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.edf'''&amp;lt;/span&amp;gt;&amp;quot;. Export of '''Epochs around triggers''' to EDF+ is currently not possible.&lt;br /&gt;
&lt;br /&gt;
* '''Simple binary matrix''': Data are written to a floating point binary matrix with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.dat'''&amp;lt;/span&amp;gt;&amp;quot;. The matrix has the dimension no of samples x no of channels. In addition, a header file with the extension &amp;quot;&amp;lt;span style=&amp;quot;color:#ff9c00;&amp;quot;&amp;gt;'''.generic'''&amp;lt;/span&amp;gt;&amp;quot; is also written. The header file is a text file contains information about the number of channels, sampling rate, and number of samples. These follow the specifications of the Generic File Format that can also be read by BESA Research if the Generic Reader is installed. This data format can be useful as a means of transferring data to other programs (e.g. '''MATLAB''') in a relatively compact form. If the type of data to export is '''Epochs around triggers''', the epochs are concatenated in the same target file. In this case, the header file contains a line specifying the number of epochs (cf. ''Generic File Format''). The number of samples in each epoch is the total number of samples, divided by the number of epochs.&lt;br /&gt;
&lt;br /&gt;
* '''Send To MATLAB''': The data are exported directly to MATLAB into the struct variable &amp;lt;code&amp;gt;besa_channels&amp;lt;/code&amp;gt;. For more information on the data transfer from BESA Research to MATLAB, please refer to the Help chapter [[MATLAB_Interface | MATLAB interface]].&lt;br /&gt;
&lt;br /&gt;
== Resampling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (5).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check '''Resample data''' to change the sampling rate of the target data. The edit box is enabled, and you specify a sampling rate.&lt;br /&gt;
&lt;br /&gt;
Data are resampled using splines. Thus, the new sampling rate is not limited to fractions or multiples of the original rate.&lt;br /&gt;
&lt;br /&gt;
Note that if '''Resample data''' is not checked, the sampling rate of the source data is displayed.&lt;br /&gt;
&lt;br /&gt;
'''Resampling and aliasing'''. If you want to reduce the sampling rate it is important to avoid aliasing! It is recommended that a low-pass filter with a boundary frequency of not more than 1/3 of the original sampling rate is used. When you set a new sampling rate, BESA Research checks the current filter settings. If export without filters is selected, or if the current low-pass filter is set to a value that is higher than 1/3 of the sampling rate, BESA Research sets the filter, and opens a message box with a warning:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Export (6).gif ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You may adjust the filters by pressing the&amp;lt;span style=&amp;quot;color:#3366ff;&amp;quot;&amp;gt;''' Filter'''&amp;lt;/span&amp;gt; button, e.g. if the original data were already recorded with a sufficiently low low-pass filter setting, so that additional filtering is unnecessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Compression ==&lt;br /&gt;
&lt;br /&gt;
When exporting to BESA binary format and ASCII multiplex formats, you can compress the data to save space. Here we describe properties and pitfalls of the compression algorithm.&lt;br /&gt;
&lt;br /&gt;
=== Compression of BESA binary data ===&lt;br /&gt;
&lt;br /&gt;
'''How compression works'''&lt;br /&gt;
&lt;br /&gt;
The compression algorithm works on two principals:&lt;br /&gt;
* '''Data resolution can often be reduced without losing data quality.''' For instance, a data resolution of 0.1 µV or higher is unnecessary for viewing normal EEG -- 0.5 µV or 1 µV steps are sufficient. Similarly for event-related potentials: the raw data only require a resolution of 0.5 µV or 1 µV to achieve a much higher resolution after averaging.&lt;br /&gt;
* '''Differences between successive data samples''' on a signal are generally much smaller than '''the absolute values of the data'''. Thus, one start value, and then a series of subsequent differences can be stored in a much smaller space than an equivalent series of absolute values. A consequence of this principle is that smoothed signals (with high frequencies removed) can be compressed into a smaller space than signals with a lot of high frequency noise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Compression parameter'''&lt;br /&gt;
&lt;br /&gt;
The parameter you need to choose is the data resolution, or step size. Steps smaller than this size will no longer be represented in the compressed data. The BESA Research Export Module allows the following steps for the compression of EEG signals:&lt;br /&gt;
&lt;br /&gt;
0.1 µV, 0.2 µV, 0.5 µV, 1 µV&lt;br /&gt;
&lt;br /&gt;
For raw EEG data, we recommend using a step size of 0.5 µV.&lt;br /&gt;
&lt;br /&gt;
'''Different compression parameters for different data types (pitfalls!)'''&lt;br /&gt;
&lt;br /&gt;
As described above, the step sizes make sense for EEG signals. For other types of data, other step sizes make more sense. In addition, a polygraphic signal can have the same order of signal magnitude as the EEG (e.g. an EOG or EKG signal), but it might have a completely different scale, e.g. a voice signal, recorded in mV or V. To help accommodate different orders of signal magnitude, BESA Research applies the following rules:&lt;br /&gt;
* '''MEG data:''' Step sizes (in units of fT) are 20 x the step size in µV. Thus, a step size of 0.5 µV will lead to a step size of 10 fT for MEG data.&lt;br /&gt;
* '''Polygraphic and ICR data''': The step size depends on the current amplitude scaling factor in BESA Research. A multiplication factor is used that is the current scaling factor, divided by 100. Thus, if the scale is set to 1 V, the factor is 10 mV. If you have chosen an EEG step size of 0.5 µV, the resulting step size will be 10 x 0.5 = 5 mV.&lt;br /&gt;
&lt;br /&gt;
A pitfall in compression is that if the current amplitude scaling for polygraphic or ICR data does not display the signal sensibly, compression may lead to complete loss of the signal. Note that this only applies to polygraphic and ICR channel types.&lt;br /&gt;
&lt;br /&gt;
* '''Averages:''' We recommend that averaged ERPs are not compressed. Since the signals are generally much smaller than the raw data, compression will lead to unacceptable loss of data resolution.&lt;br /&gt;
&lt;br /&gt;
=== Compression of ASCII multiplexed data ===&lt;br /&gt;
&lt;br /&gt;
When compression is specified, data are written as integer values, and the scaling is specified in the header line of the *.mul file as ''Bins/uV=xxx''. &lt;br /&gt;
&lt;br /&gt;
With no compression, the header contains ''Bins/uV=1.0'', and the data are written with 7 characters per number (e.g. -4.5084, 2.57239).&lt;br /&gt;
&lt;br /&gt;
With compression, the data are written as integers, e.g. 0 -10 -6 -4, which can lead to considerably less characters and thus&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! No compression&lt;br /&gt;
! 0.1&lt;br /&gt;
! 0.2&lt;br /&gt;
! 0.5&lt;br /&gt;
! 1.0&lt;br /&gt;
|-&lt;br /&gt;
| -4.5084&lt;br /&gt;
| -4.5 (-45)&lt;br /&gt;
| -4.6 (-23)&lt;br /&gt;
| -4.5 (-9)&lt;br /&gt;
| -5.0 (-5)&lt;br /&gt;
|-&lt;br /&gt;
| 2.57239&lt;br /&gt;
| 2.6 (26)&lt;br /&gt;
| 2.6 (13)&lt;br /&gt;
| 2.5 (5)&lt;br /&gt;
| 3.0 (3)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The numbers in brackets are the values written to the data file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Research Manual]]&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Event_File_Format</id>
		<title>Event File Format</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Event_File_Format"/>
				<updated>2021-05-05T14:05:57Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
Event files (extension *.evt) contain triggers and events and can be loaded as an additional file to provide more information about the whole course of an EEG/MEG recording.&lt;br /&gt;
An event file can be edited by opening it in any text editor, e.g. Notepad. It is also possible to create new event files from scratch which can be imported into the data file later. &lt;br /&gt;
Note the following conventions for event files:&lt;br /&gt;
* Event descriptions are given in the columns of the event file&lt;br /&gt;
* Each file must contain a header line and data lines&lt;br /&gt;
&lt;br /&gt;
=== File Header ===&lt;br /&gt;
&lt;br /&gt;
The header is comprised of abbreviated descriptions for each column. Each entry in the data line must be specified in the header line at the correct column position. The order of the data elements and their description in the header line can be chosen arbitrarily and the entries can be separated by commas, tabs and/or spaces. The Code and one of ''Tms'', ''Tmu'' or ''Tsec'' are obligatory, other data elements can be omitted. The following codes are recognized by the ERP module:&lt;br /&gt;
* ''Code'' - event code (integer, see section [[#Event Codes|Event Codes]])&lt;br /&gt;
* ''Tms'' - event time in milliseconds relative to the start of the data file or ''Tmu'' [in microseconds] or ''Tsec'' [in sec] (floating point value)&lt;br /&gt;
* ''TriNo'' - trigger number (integer) (identifies the trigger in the event bar of the main module)&lt;br /&gt;
* ''RCode'' - reaction code (integer)&lt;br /&gt;
* ''RTms'' - reaction time in milliseconds or ''RTmu'' or ''RTsec'' (floating point value)&lt;br /&gt;
* ''Comnt'' - comment to describe event (string of up to 39 characters), will be truncated if longer than 39 characters. &lt;br /&gt;
You can also define columns which should not be recognized by the ERP module. Simply specify these columns in the header with any unknown code. Therefore you might be able to use previously generated files without major changes. &lt;br /&gt;
&lt;br /&gt;
=== Event Codes ===&lt;br /&gt;
&lt;br /&gt;
The event code Code must be one of the following integers:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | Code&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | Event/Trigger Type&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Trigger&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Comment&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Marker&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Pattern1&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Pattern2&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| Pattern3&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Pattern4&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Pattern5&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Artifact on&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Artifact off&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Epoch on&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Epoch off&lt;br /&gt;
|-&lt;br /&gt;
| 41&lt;br /&gt;
| New segment&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Average segment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Additional Event Information ===&lt;br /&gt;
&lt;br /&gt;
The event reaction time, event reaction code and event comment are represented by the comment in the main module as &amp;quot;''Comment (Rx,T____)''&amp;quot;, where ''Comment'' is the event comment, ''x'' describes the reaction code and the underscored line will be filled with the reaction time. Reaction time and reaction code are only read if the event code specifies it as a trigger.&lt;br /&gt;
A &amp;quot;New Segment&amp;quot; event can include time information that defines the starting time of the segment. This is defined in the ''TriNo'' column of the event file. The format is YYYY-MM-DDTHH:MM:SS, e.g. 2010-04-26T15:30:20.31 (note: seconds are a decimal number). If no time is defined, use a hyphen ('-'). See [[#Examples|Examples]] below.&lt;br /&gt;
An &amp;quot;Average Segment&amp;quot; includes the prestimulus baseline interval in microseconds. This is defined in the ''TriNo'' column of the event file.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
The file is valid if the header line contains at least the entries Code and one of ''Tms'', ''Tmu'' and ''Tsec''. The header specifications are case insensitive.&lt;br /&gt;
The file is invalid, if&lt;br /&gt;
* there are ambiguities in the header &lt;br /&gt;
* there is a data type mismatch in the data line &lt;br /&gt;
* an event time specifies an event which happened later than the end of the acquisition&lt;br /&gt;
Each omitted data entry is set to 0 or empty string by default.&lt;br /&gt;
A line with an invalid or unknown event code ''Code'' is skipped.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here are a couple of typical examples:&lt;br /&gt;
&lt;br /&gt;
'''1) Simple trigger file'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tms&lt;br /&gt;
| Code&lt;br /&gt;
| TriNo&lt;br /&gt;
| Comnt&lt;br /&gt;
|-&lt;br /&gt;
| 100.234&lt;br /&gt;
| 1&lt;br /&gt;
| 3&lt;br /&gt;
| Trigger: 3&lt;br /&gt;
|-&lt;br /&gt;
| 2300.456&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| Trigger:1&lt;br /&gt;
|-&lt;br /&gt;
| 4500.21&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| Trigger:1&lt;br /&gt;
|-&lt;br /&gt;
| 9800.47&lt;br /&gt;
| 1&lt;br /&gt;
| 7&lt;br /&gt;
| Trigger:7&lt;br /&gt;
|-&lt;br /&gt;
| 12500.78&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| Trigger:2&lt;br /&gt;
|-&lt;br /&gt;
| 21237&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| Trigger:1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample1.evt|Example 1]]&lt;br /&gt;
&lt;br /&gt;
'''2) Trigger file with reaction code and reaction time'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tms&lt;br /&gt;
| Code&lt;br /&gt;
| TriNo&lt;br /&gt;
| RTsec&lt;br /&gt;
| RCode&lt;br /&gt;
|-&lt;br /&gt;
| 100.234&lt;br /&gt;
| 1&lt;br /&gt;
| 3&lt;br /&gt;
| 0.23&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2300.456&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1.11&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 4500.21&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 0.15&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 9800.47&lt;br /&gt;
| 1&lt;br /&gt;
| 7&lt;br /&gt;
| 0.87&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| 12500.78&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 2.1&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 21237&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample2.evt|Example 2]]&lt;br /&gt;
&lt;br /&gt;
'''3) Event file without triggers'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tmu&lt;br /&gt;
| Code&lt;br /&gt;
| Comnt&lt;br /&gt;
|-&lt;br /&gt;
| 10000.234&lt;br /&gt;
| 3&lt;br /&gt;
| Marker&lt;br /&gt;
|-&lt;br /&gt;
| 230000.456&lt;br /&gt;
| 12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 450000.21&lt;br /&gt;
| 14&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 980000.47&lt;br /&gt;
| 12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 1250000.78&lt;br /&gt;
| 3&lt;br /&gt;
| Marker&lt;br /&gt;
|-&lt;br /&gt;
| 2123700&lt;br /&gt;
| 2&lt;br /&gt;
| Comment&lt;br /&gt;
|-&lt;br /&gt;
| 2534100.567&lt;br /&gt;
| 15&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample3.evt|Example 3]]&lt;br /&gt;
&lt;br /&gt;
'''4) File including triggers and events'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tms&lt;br /&gt;
| Code&lt;br /&gt;
| TriNo&lt;br /&gt;
| RTsec&lt;br /&gt;
| RCode&lt;br /&gt;
| Comnt&lt;br /&gt;
|-&lt;br /&gt;
| 100.234&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| CommentSet&lt;br /&gt;
|-&lt;br /&gt;
| 2300.456&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 4500.21&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 0.15&lt;br /&gt;
| 1&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 9800.47&lt;br /&gt;
| 11&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 12500.78&lt;br /&gt;
| 3&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 21237&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| Comment&lt;br /&gt;
|-&lt;br /&gt;
| 25341.567&lt;br /&gt;
| 15&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample4.evt|Example 4]]&lt;br /&gt;
&lt;br /&gt;
'''5) New Segments'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tms&lt;br /&gt;
| Code&lt;br /&gt;
| TriNo&lt;br /&gt;
| Comnt&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 41&lt;br /&gt;
| 2010-04-26T15:30:20.31&lt;br /&gt;
| Start recording&lt;br /&gt;
|-&lt;br /&gt;
| 21000&lt;br /&gt;
| 41&lt;br /&gt;
| 2010-04-27T09:17:00.0&lt;br /&gt;
| Next day&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The new segment at the time 0 overrides the start time in the file.&lt;br /&gt;
A second segment at 21 s starts a new data block one day later at 9:17.&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample5.evt|Example 5]]&lt;br /&gt;
&lt;br /&gt;
'''6) Average Segments'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tms&lt;br /&gt;
| Code&lt;br /&gt;
| TriNo&lt;br /&gt;
| Comnt&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 42&lt;br /&gt;
| 100000&lt;br /&gt;
| Cond 1: 25 avs&lt;br /&gt;
|-&lt;br /&gt;
| 1100&lt;br /&gt;
| 42&lt;br /&gt;
| 200000&lt;br /&gt;
| Cond 2: 201 avs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The file contains two average segments. The first, with a prestimulus interval of 100 ms, has a duration of 1100 ms. The second, with a prestimulus interval of 200 ms, has a length up to the end of the data file.&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample6.evt|Example 6]]&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Event_File_Format</id>
		<title>Event File Format</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Event_File_Format"/>
				<updated>2021-05-05T14:05:08Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 5.2 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
Event files (extension *.evt) contain triggers and events and can be loaded as an additional file to provide more information about the whole course of an EEG/MEG recording.&lt;br /&gt;
An event file can be edited by opening it in any text editor, e.g. Notepad. It is also possible to create new event files from scratch which can be imported into the data file later. &lt;br /&gt;
Note the following conventions for event files:&lt;br /&gt;
* Event descriptions are given in the columns of the event file&lt;br /&gt;
* Each file must contain a header line and data lines&lt;br /&gt;
&lt;br /&gt;
=== File Header ===&lt;br /&gt;
&lt;br /&gt;
The header is comprised of abbreviated descriptions for each column. Each entry in the data line must be specified in the header line at the correct column position. The order of the data elements and their description in the header line can be chosen arbitrarily and the entries can be separated by commas, tabs and/or spaces. The Code and one of ''Tms'', ''Tmu'' or ''Tsec'' is obligatory, other data elements can be omitted. The following codes are recognized by the ERP module:&lt;br /&gt;
* ''Code'' - event code (integer, see section [[#Event Codes|Event Codes]])&lt;br /&gt;
* ''Tms'' - event time in milliseconds relative to the start of the data file or ''Tmu'' [in microseconds] or ''Tsec'' [in sec] (floating point value)&lt;br /&gt;
* ''TriNo'' - trigger number (integer) (identifies the trigger in the event bar of the main module)&lt;br /&gt;
* ''RCode'' - reaction code (integer)&lt;br /&gt;
* ''RTms'' - reaction time in milliseconds or ''RTmu'' or ''RTsec'' (floating point value)&lt;br /&gt;
* ''Comnt'' - comment to describe event (string of up to 39 characters), will be truncated if longer than 39 characters. &lt;br /&gt;
You can also define columns which should not be recognized by the ERP module. Simply specify these columns in the header with any unknown code. Therefore you might be able to use previously generated files without major changes. &lt;br /&gt;
&lt;br /&gt;
=== Event Codes ===&lt;br /&gt;
&lt;br /&gt;
The event code Code must be one of the following integers:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | Code&lt;br /&gt;
! style=&amp;quot;text-align: center; font-weight: bold;&amp;quot; | Event/Trigger Type&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Trigger&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Comment&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Marker&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Pattern1&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Pattern2&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| Pattern3&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Pattern4&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Pattern5&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Artifact on&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Artifact off&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Epoch on&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Epoch off&lt;br /&gt;
|-&lt;br /&gt;
| 41&lt;br /&gt;
| New segment&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Average segment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Additional Event Information ===&lt;br /&gt;
&lt;br /&gt;
The event reaction time, event reaction code and event comment are represented by the comment in the main module as &amp;quot;''Comment (Rx,T____)''&amp;quot;, where ''Comment'' is the event comment, ''x'' describes the reaction code and the underscored line will be filled with the reaction time. Reaction time and reaction code are only read if the event code specifies it as a trigger.&lt;br /&gt;
A &amp;quot;New Segment&amp;quot; event can include time information that defines the starting time of the segment. This is defined in the ''TriNo'' column of the event file. The format is YYYY-MM-DDTHH:MM:SS, e.g. 2010-04-26T15:30:20.31 (note: seconds are a decimal number). If no time is defined, use a hyphen ('-'). See [[#Examples|Examples]] below.&lt;br /&gt;
An &amp;quot;Average Segment&amp;quot; includes the prestimulus baseline interval in microseconds. This is defined in the ''TriNo'' column of the event file.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
The file is valid if the header line contains at least the entries Code and one of ''Tms'', ''Tmu'' and ''Tsec''. The header specifications are case insensitive.&lt;br /&gt;
The file is invalid, if&lt;br /&gt;
* there are ambiguities in the header &lt;br /&gt;
* there is a data type mismatch in the data line &lt;br /&gt;
* an event time specifies an event which happened later than the end of the acquisition&lt;br /&gt;
Each omitted data entry is set to 0 or empty string by default.&lt;br /&gt;
A line with an invalid or unknown event code ''Code'' is skipped.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Here are a couple of typical examples:&lt;br /&gt;
&lt;br /&gt;
'''1) Simple trigger file'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tms&lt;br /&gt;
| Code&lt;br /&gt;
| TriNo&lt;br /&gt;
| Comnt&lt;br /&gt;
|-&lt;br /&gt;
| 100.234&lt;br /&gt;
| 1&lt;br /&gt;
| 3&lt;br /&gt;
| Trigger: 3&lt;br /&gt;
|-&lt;br /&gt;
| 2300.456&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| Trigger:1&lt;br /&gt;
|-&lt;br /&gt;
| 4500.21&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| Trigger:1&lt;br /&gt;
|-&lt;br /&gt;
| 9800.47&lt;br /&gt;
| 1&lt;br /&gt;
| 7&lt;br /&gt;
| Trigger:7&lt;br /&gt;
|-&lt;br /&gt;
| 12500.78&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| Trigger:2&lt;br /&gt;
|-&lt;br /&gt;
| 21237&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| Trigger:1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample1.evt|Example 1]]&lt;br /&gt;
&lt;br /&gt;
'''2) Trigger file with reaction code and reaction time'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tms&lt;br /&gt;
| Code&lt;br /&gt;
| TriNo&lt;br /&gt;
| RTsec&lt;br /&gt;
| RCode&lt;br /&gt;
|-&lt;br /&gt;
| 100.234&lt;br /&gt;
| 1&lt;br /&gt;
| 3&lt;br /&gt;
| 0.23&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2300.456&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 1.11&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 4500.21&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 0.15&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 9800.47&lt;br /&gt;
| 1&lt;br /&gt;
| 7&lt;br /&gt;
| 0.87&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| 12500.78&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 2.1&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 21237&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample2.evt|Example 2]]&lt;br /&gt;
&lt;br /&gt;
'''3) Event file without triggers'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tmu&lt;br /&gt;
| Code&lt;br /&gt;
| Comnt&lt;br /&gt;
|-&lt;br /&gt;
| 10000.234&lt;br /&gt;
| 3&lt;br /&gt;
| Marker&lt;br /&gt;
|-&lt;br /&gt;
| 230000.456&lt;br /&gt;
| 12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 450000.21&lt;br /&gt;
| 14&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 980000.47&lt;br /&gt;
| 12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 1250000.78&lt;br /&gt;
| 3&lt;br /&gt;
| Marker&lt;br /&gt;
|-&lt;br /&gt;
| 2123700&lt;br /&gt;
| 2&lt;br /&gt;
| Comment&lt;br /&gt;
|-&lt;br /&gt;
| 2534100.567&lt;br /&gt;
| 15&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample3.evt|Example 3]]&lt;br /&gt;
&lt;br /&gt;
'''4) File including triggers and events'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tms&lt;br /&gt;
| Code&lt;br /&gt;
| TriNo&lt;br /&gt;
| RTsec&lt;br /&gt;
| RCode&lt;br /&gt;
| Comnt&lt;br /&gt;
|-&lt;br /&gt;
| 100.234&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| CommentSet&lt;br /&gt;
|-&lt;br /&gt;
| 2300.456&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 4500.21&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 0.15&lt;br /&gt;
| 1&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 9800.47&lt;br /&gt;
| 11&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 12500.78&lt;br /&gt;
| 3&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 21237&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| Comment&lt;br /&gt;
|-&lt;br /&gt;
| 25341.567&lt;br /&gt;
| 15&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample4.evt|Example 4]]&lt;br /&gt;
&lt;br /&gt;
'''5) New Segments'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tms&lt;br /&gt;
| Code&lt;br /&gt;
| TriNo&lt;br /&gt;
| Comnt&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 41&lt;br /&gt;
| 2010-04-26T15:30:20.31&lt;br /&gt;
| Start recording&lt;br /&gt;
|-&lt;br /&gt;
| 21000&lt;br /&gt;
| 41&lt;br /&gt;
| 2010-04-27T09:17:00.0&lt;br /&gt;
| Next day&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The new segment at the time 0 overrides the start time in the file.&lt;br /&gt;
A second segment at 21 s starts a new data block one day later at 9:17.&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample5.evt|Example 5]]&lt;br /&gt;
&lt;br /&gt;
'''6) Average Segments'''&lt;br /&gt;
{| style=&amp;quot;border-spacing: 2px; border: 0px white;&amp;quot;&lt;br /&gt;
| Tms&lt;br /&gt;
| Code&lt;br /&gt;
| TriNo&lt;br /&gt;
| Comnt&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 42&lt;br /&gt;
| 100000&lt;br /&gt;
| Cond 1: 25 avs&lt;br /&gt;
|-&lt;br /&gt;
| 1100&lt;br /&gt;
| 42&lt;br /&gt;
| 200000&lt;br /&gt;
| Cond 2: 201 avs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The file contains two average segments. The first, with a prestimulus interval of 100 ms, has a duration of 1100 ms. The second, with a prestimulus interval of 200 ms, has a length up to the end of the data file.&lt;br /&gt;
&lt;br /&gt;
This example event file can be downloaded here: [[Media:EventFileExample6.evt|Example 6]]&lt;br /&gt;
&lt;br /&gt;
[[Category:ERP/ERF]] [[Category:Data Import/Export]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Change_Waveform_Colours</id>
		<title>Change Waveform Colours</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Change_Waveform_Colours"/>
				<updated>2021-05-05T12:59:06Z</updated>
		
		<summary type="html">&lt;p&gt;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 = BESA Research 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Colours of channel waveforms and labels may be modified by changing the corresponding entry in the Montage Editor configuration file '''BesaME.cfg''', which is separately stored for each user.&lt;br /&gt;
&lt;br /&gt;
The configuration file is located in the current user's folder, usually '''C:\Users\&amp;lt;User name&amp;gt;\Documents\BESA\&amp;lt;Research_X_Y&amp;gt;\Settings'''.  Here, ''&amp;lt;Research_X_Y&amp;gt;'' specifies the BESA Research version (I.e. Research_7_1_ and ''&amp;lt;User name&amp;gt;'' is the user name which was used to log on to Windows.&lt;br /&gt;
&lt;br /&gt;
The colours may be set in the section '''[Colors]'''. If this section is not available, please add the '''[Colors]''' line (no quotes) at the end of the file and write the color modifications below this line.&lt;br /&gt;
&lt;br /&gt;
Various features for various group of channels and channel subselection can be set. the convention is '''FeatureChannels_Sub'''&lt;br /&gt;
&lt;br /&gt;
Following features can be used:&lt;br /&gt;
* ColText&lt;br /&gt;
* ColPlot&lt;br /&gt;
* ColWave&lt;br /&gt;
&lt;br /&gt;
Following Channel groups can be used:&lt;br /&gt;
* RecordedElectrode&lt;br /&gt;
* VirtualElectrode&lt;br /&gt;
* InterpolatedElectrode&lt;br /&gt;
* SingleDipole&lt;br /&gt;
* RegionalSource&lt;br /&gt;
* SpatialComponent&lt;br /&gt;
* Magnetometer&lt;br /&gt;
* Gradiometer&lt;br /&gt;
* InterpolatedChanMEG&lt;br /&gt;
* IntracranialChannel&lt;br /&gt;
* PolygraficChannel&lt;br /&gt;
* BadChannel&lt;br /&gt;
* UnavailableElectrode&lt;br /&gt;
* RecordedMontageChannel*&lt;br /&gt;
* VirtualMontageChannel*&lt;br /&gt;
* MEGMontageChannel*&lt;br /&gt;
* UnavailableMontageChannel*&lt;br /&gt;
* AddChanMontage&lt;br /&gt;
&lt;br /&gt;
For channel groups: RecordedElectrode, VirtualElectrode, InterpolatedElectrode, SingleDipole, RegionalSource following sub selection should be added for ColWave feature:&lt;br /&gt;
* Left&lt;br /&gt;
* Right&lt;br /&gt;
* Mid&lt;br /&gt;
&lt;br /&gt;
For ColPlot feature following sub-selection can be added for sensors:&lt;br /&gt;
* Selected&lt;br /&gt;
* Highlighted (only for MontageChannel groups)&lt;br /&gt;
* SelectedHighlighted (only for ...MontageChannel groups)&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;''ColText...''&amp;quot; colours specify the colours of the channel labels. The &amp;quot;''ColPlot...''&amp;quot; colours specify the colours used for display in the Montage Editor. The &amp;quot;''ColWave...''&amp;quot; colours specify the colours of the channel waveforms. It is recommended to use the same or similar colour for the 3 corresponding entries.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;''...RecordedElectrode...''&amp;quot; indicate which type of channel should be affected. Note that there are special groups &amp;quot;''...MontageChannel''&amp;quot;. For this group only ColPlor feature can be used. &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;''..._Left''&amp;quot;  sub selection indicates that only sensors located over left hemisphere will be affected by this setting. Note that this subselection can be used an is obligatory for EEG sensors and sources. &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;''..._Selected''&amp;quot; sub selection indicates colour setting for colour of highlight of channel in Montage editor (while channel is selected in channel list). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;''..._Highligthed''&amp;quot; and &amp;quot;''..._SelectedHighlighted''&amp;quot; indicate colour setting for channel selection by mouse hover or selection respectively in Montage editor topographical view. Note that this setting is only possible for special groups &amp;quot;''...MontageChannel''&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The colour values are given in [RED,GREEN,BLUE] triples, each value may range from 0 (weakest intensity) to 255 (maximum intensity). For internal reasons, the &amp;quot;''ColText...''&amp;quot; and &amp;quot;''ColPlot...''&amp;quot; colours must not be deep black (000,000,000). If a black colour should be set, use a colour close to black (see line ColTextPolygraficChannel=000,000,001). The difference will not be visible. &lt;br /&gt;
&lt;br /&gt;
Note that the configuration file is written when the program is closed. So do not change it while BESA Research is open. Otherwise, your changes will be&lt;br /&gt;
lost at program termination.&lt;br /&gt;
&lt;br /&gt;
The example of colour settings (the colour triples show the default values):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | [Colors]&lt;br /&gt;
|-&lt;br /&gt;
| ColTextRecordedElectrode=000,000,128&lt;br /&gt;
|-&lt;br /&gt;
| ColPlotRecordedElectrode=160,160,255&lt;br /&gt;
|-&lt;br /&gt;
| ColPlotRecordedElectrode_Selected=160,160,255&lt;br /&gt;
|-&lt;br /&gt;
| ColWaveRecordedElectrode_Left=000,000,128&lt;br /&gt;
|-&lt;br /&gt;
| ColWaveRecordedElectrode_Mid=000,000,000&lt;br /&gt;
|-&lt;br /&gt;
| ColWaveRecordedElectrode_Right=128,000,000&lt;br /&gt;
|-&lt;br /&gt;
| ColPlotRecordedMontageChannel=000,000,255&lt;br /&gt;
|-&lt;br /&gt;
| ColPlotRecordedMontageChannel_Selected=000,000,130&lt;br /&gt;
|-&lt;br /&gt;
| ColPlotRecordedMontageChannel_Highlighted=230,230,000&lt;br /&gt;
|-&lt;br /&gt;
| ColPlotRecordedMontageChannel_SelectedHilighted=215,215,000&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| ColTextMagnetometer=110,000,110&lt;br /&gt;
|-&lt;br /&gt;
| ColPlotMagnetometer=110,020,110&lt;br /&gt;
|-&lt;br /&gt;
| ColWaveMagnetometer=110,000,110&lt;br /&gt;
|-&lt;br /&gt;
| ColTextGradiometer=110,000,110&lt;br /&gt;
|-&lt;br /&gt;
| ColPlotGradiometer=110,020,110&lt;br /&gt;
|-&lt;br /&gt;
| ColWaveGradiometer=110,000,110&lt;br /&gt;
|-&lt;br /&gt;
| ColTextIntracranialChannel=104,050,000&lt;br /&gt;
|-&lt;br /&gt;
| ColPlotIntracranialChannel=104,050,020&lt;br /&gt;
|-&lt;br /&gt;
| ColWaveIntracranialChannel=104,050,000&lt;br /&gt;
|-&lt;br /&gt;
| ColTextPolygraficChannel=000,000,001&lt;br /&gt;
|-&lt;br /&gt;
| ColPlotPolygraficChannel=000,000,001&lt;br /&gt;
|-&lt;br /&gt;
| ColWavePolygraficChannel=000,000,000&lt;br /&gt;
|-&lt;br /&gt;
| ColTextAddChanMontage=110,000,255&lt;br /&gt;
|-&lt;br /&gt;
| ColWaveAddChanMontage=110,000,255&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Review]]&lt;/div&gt;</summary>
		<author><name>Mateusz</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-05T08:03:47Z</updated>
		
		<summary type="html">&lt;p&gt;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|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 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; 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 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;
| 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 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>Mateusz</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:49:14Z</updated>
		
		<summary type="html">&lt;p&gt;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;/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>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Discrete_Sources</id>
		<title>Discrete Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Discrete_Sources"/>
				<updated>2021-05-04T15:05:19Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A source is used to model the electro-magnetic activity caused by patches of simultaneously active neurons. There are three types of sources in BESA: &lt;br /&gt;
&lt;br /&gt;
* [[Image:singleDipole.png|40px]] [[#Single Dipole | single dipoles]],&lt;br /&gt;
* [[Image:regionalSource.png|40px]] [[#Regional Source | regional sources]],&lt;br /&gt;
* [[Image:spatialComponent.png|40px]] [[#Spatial Component | spatial components]].&lt;br /&gt;
&lt;br /&gt;
In case of MRI-coregistered datasets the [[#Confidence Ellipsoid and Error Rim | confidence ellipsoid and error rim]] can be displayed for single dipoles and regional sources.&lt;br /&gt;
&lt;br /&gt;
== Single Dipole ==&lt;br /&gt;
&lt;br /&gt;
[[Image:singleDipole.png|40px]] A single dipole source (abbreviation: ''SD'' or ''Dip'') can be regarded as an electric current dipole, which is used for the physical modeling of the physiological activity. It is described by a location and an orientation, and the source waveform describes its amplitude over time.&lt;br /&gt;
&lt;br /&gt;
'''Selected Source'''&lt;br /&gt;
&lt;br /&gt;
A source is selected by clicking onto the source plot in the head box or by clicking onto the source waveform in the source box. It is deselected by selecting another source or by clicking beneath any source plot in the head box.&lt;br /&gt;
&lt;br /&gt;
The selected source is marked with a circle around its source plots in the head box, with a golden halo in the 3D window and a colored rectangle around its On/Off and Fit/No fit button in the source box. If a source is selected its parameters are displayed in the parameter box.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Regional Source ==&lt;br /&gt;
&lt;br /&gt;
[[Image:regionalSource.png|40px]] A regional source (abbreviation: ''RS'') is a source which describes all activity originating in the vicinity of its location. It can be regarded as a source with three (MEG spherical head models: two) [[#Single Dipole| single dipoles]] (called components) at the same location but with orthogonal orientations.&lt;br /&gt;
&lt;br /&gt;
[[Image:orientedRegionalSource.png|40px]] A regional source can be rotated such that one of the single orientations of its components explains a maximum of activity at a specified sample. If a regional source has been rotated, the orientation of each component is displayed in the [[Source_Analysis_Functions_of_the_Window#Head_Box | head box]], otherwise only the source body is displayed.&lt;br /&gt;
&lt;br /&gt;
== Spatial Component ==&lt;br /&gt;
&lt;br /&gt;
[[Image:spatialComponent.png|40px]] A spatial component (abbreviation: ''SpC'') is a source represented by a principal vector. This principal vector results from a Principal Component Analysis (PCA) or Independent Component Analysis (ICA) of the covariance data matrix, from the RAP-Music algorithm, or from the measured data at the cursor sample. It describes the contribution of the source at the sensors. The topography of a spatial component need not be of dipolar nature.&lt;br /&gt;
&lt;br /&gt;
If the spatial component results from a PCA, ICA, or the cursor sample, its location is reconstructed by an approximation. Spatial components created by RAP-Music have exactly defined location and orientation but can consist of two components (with one resulting principal vector).&lt;br /&gt;
&lt;br /&gt;
== Confidence Ellipsoid and Error Rim ==&lt;br /&gt;
''(requires BESA Research 7.1 or higher)''&lt;br /&gt;
&lt;br /&gt;
For [[#DSingle Dipole | dipole solutions]] and [[#Regional Source | oriented regional sources]], confidence limits are calculated, displayed, and stored. The last fit interval used for a source is relevant for computing the confidence limit. This interval is also stored with the solution. In case of multi-dipole solutions or solutions which include spatial components, the full source model is taken into account for computation. Confidence limits are written to solution files if the coordinate system for export is set to Talairach. For these solutions, an import and display of the solution in BESA MRI is possible (BESA MRI 3.0 or higher). The limit that is computed corresponds to the 95% confidence limit. Computation follows the approach of M. Hämäläinen (Interpretation of neuromagnetic measurements: modeling and statistical considerations, PhD thesis at Helsinki University of Technology 1987, pp 27 ff). &lt;br /&gt;
&lt;br /&gt;
* Note: Confidence limit display in the MRI window is only active if an individual MRI was co-registered.&lt;br /&gt;
* Also note that the confidence limit computed requires a baseline interval that is well defined. The baseline interval can be adjusted by clicking on the baseline indicator bar at the top left of the Source Analysis window. &lt;br /&gt;
* Confidence limits depend on many factors including the number of active sources, the signal-to-noise ratio, and the fit interval. In particular, the confidence limit does not account for other errors, e.g. head model errors, co-registration errors, or influence of artifacts on the solution. They should be regarded as a guideline and serve as a lower limit to the confidence of the solution, not as an upper limit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The confidence ellipsoid radii are computed as follows:'''&lt;br /&gt;
&lt;br /&gt;
First the data predicted by the model (b) is computed using fitting time point i or the fitting interval, and predicted source strength from the inverse operator applied to measured data.&lt;br /&gt;
&lt;br /&gt;
ji is calculated for the time point. Then the Jabobian J can be defined as change in b when moving the dipole in the three main axes of the ellipsoid, e.g. for the first axis (depicted as x axis here):&lt;br /&gt;
&lt;br /&gt;
[[Image:confidenceEllipsoid_eq01.png]] &lt;br /&gt;
&lt;br /&gt;
where h is sufficiently small.&lt;br /&gt;
&lt;br /&gt;
Then compute the C matrix (3x3) from which radii (∆x,∆y,∆z) for a 95% confidence interval can be defined:&lt;br /&gt;
&lt;br /&gt;
[[Image:confidenceEllipsoid_eq02.png]] &lt;br /&gt;
&lt;br /&gt;
[[Image:confidenceEllipsoid_eq03.png]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
* Hämäläinen, M., 1987. Interpretation of neuromagnetic measurements : modeling and statistical considerations. Helsinki University of Technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Discrete_Sources</id>
		<title>Discrete Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Discrete_Sources"/>
				<updated>2021-05-04T14:15:31Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A source is used to model the electro-magnetic activity caused by patches of simultaneously active neurons. There are three types of sources in BESA: &lt;br /&gt;
&lt;br /&gt;
* [[Image:singleDipole.png|40px]] [[#Single Dipole | single dipoles]],&lt;br /&gt;
* [[Image:regionalSource.png|40px]] [[#Regional Source | regional sources]],&lt;br /&gt;
* [[Image:spatialComponent.png|40px]] [[#Spatial Component | spatial components]].&lt;br /&gt;
&lt;br /&gt;
In case of MRI-coregistered datasets the [[#Confidence Ellipsoid and Error Rim | confidence ellipsoid and error rim]] can be displayed for single dipoles and regional sources.&lt;br /&gt;
&lt;br /&gt;
== Single Dipole ==&lt;br /&gt;
&lt;br /&gt;
[[Image:singleDipole.png|40px]] A single dipole source (abbreviation: ''SD'' or ''Dip'') can be regarded as an electric current dipole, which is used for the physical modeling of the physiological activity. It is described by a location and an orientation, and the source waveform describes its amplitude over time.&lt;br /&gt;
&lt;br /&gt;
'''Selected Source'''&lt;br /&gt;
&lt;br /&gt;
A source is selected by clicking onto the source plot in the head box or by clicking onto the source waveform in the source box. It is deselected by selecting another source or by clicking beneath any source plot in the head box.&lt;br /&gt;
&lt;br /&gt;
The selected source is marked with a circle around its source plots in the head box, with a golden halo in the 3D window and a colored rectangle around its On/Off and Fit/No fit button in the source box. If a source is selected its parameters are displayed in the parameter box.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Regional Source ==&lt;br /&gt;
&lt;br /&gt;
[[Image:regionalSource.png|40px]] A regional source (abbreviation: ''RS'') is a source which describes all activity originating in the vicinity of its location. It can be regarded as a source with three (MEG spherical head models: two) [[#Single Dipole| single dipoles]] (called components) at the same location but with orthogonal orientations.&lt;br /&gt;
&lt;br /&gt;
[[Image:orientedRegionalSource.png|40px]] A regional source can be rotated such that one of the single orientations of its components explains a maximum of activity at a specified sample. If a regional source has been rotated, the orientation of each component is displayed in the [[Source_Analysis_Functions_of_the_Window#Head_Box | head box]], otherwise only the source body is displayed. (Please refer to the Set Orientation popup menu.)&lt;br /&gt;
&lt;br /&gt;
== Spatial Component ==&lt;br /&gt;
&lt;br /&gt;
[[Image:spatialComponent.png|40px]] A spatial component (abbreviation: ''SpC'') is a source represented by a principal vector. This principal vector results from a Principal Component Analysis (PCA) or Independent Component Analysis (ICA) of the covariance data matrix, from the RAP-Music algorithm, or from the measured data at the cursor sample. It describes the contribution of the source at the sensors. The topography of a spatial component need not be of dipolar nature.&lt;br /&gt;
&lt;br /&gt;
If the spatial component results from a PCA, ICA, or the cursor sample, its location is reconstructed by an approximation. Spatial components created by RAP-Music have exactly defined location and orientation but can consist of two components (with one resulting principal vector).&lt;br /&gt;
&lt;br /&gt;
== Confidence Ellipsoid and Error Rim ==&lt;br /&gt;
''(requires BESA Research 7.1 or higher)''&lt;br /&gt;
&lt;br /&gt;
For [[#DSingle Dipole | dipole solutions]] and [[#Regional Source | oriented regional sources]], confidence limits are calculated, displayed, and stored. The last fit interval used for a source is relevant for computing the confidence limit. This interval is also stored with the solution. In case of multi-dipole solutions or solutions which include spatial components, the full source model is taken into account for computation. Confidence limits are written to solution files if the coordinate system for export is set to Talairach. For these solutions, an import and display of the solution in BESA MRI is possible (BESA MRI 3.0 or higher). The limit that is computed corresponds to the 95% confidence limit. Computation follows the approach of M. Hämäläinen (Interpretation of neuromagnetic measurements: modeling and statistical considerations, PhD thesis at Helsinki University of Technology 1987, pp 27 ff). &lt;br /&gt;
&lt;br /&gt;
* Note: Confidence limit display in the MRI window is only active if an individual MRI was co-registered.&lt;br /&gt;
* Also note that the confidence limit computed requires a baseline interval that is well defined. The baseline interval can be adjusted by clicking on the baseline indicator bar at the top left of the Source Analysis window. &lt;br /&gt;
* Confidence limits depend on many factors including the number of active sources, the signal-to-noise ratio, and the fit interval. In particular, the confidence limit does not account for other errors, e.g. head model errors, co-registration errors, or influence of artifacts on the solution. They should be regarded as a guideline and serve as a lower limit to the confidence of the solution, not as an upper limit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The confidence ellipsoid radii are computed as follows:'''&lt;br /&gt;
&lt;br /&gt;
First the data predicted by the model (b) is computed using fitting time point i or the fitting interval, and predicted source strength from the inverse operator applied to measured data.&lt;br /&gt;
&lt;br /&gt;
ji is calculated for the time point. Then the Jabobian J can be defined as change in b when moving the dipole in the three main axes of the ellipsoid, e.g. for the first axis (depicted as x axis here):&lt;br /&gt;
&lt;br /&gt;
[[Image:confidenceEllipsoid_eq01.png]] &lt;br /&gt;
&lt;br /&gt;
where h is sufficiently small.&lt;br /&gt;
&lt;br /&gt;
Then compute the C matrix (3x3) from which radii (∆x,∆y,∆z) for a 95% confidence interval can be defined:&lt;br /&gt;
&lt;br /&gt;
[[Image:confidenceEllipsoid_eq02.png]] &lt;br /&gt;
&lt;br /&gt;
[[Image:confidenceEllipsoid_eq03.png]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
* Hämäläinen, M., 1987. Interpretation of neuromagnetic measurements : modeling and statistical considerations. Helsinki University of Technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Discrete_Sources</id>
		<title>Discrete Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Discrete_Sources"/>
				<updated>2021-05-04T14:14:40Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A source is used to model the electro-magnetic activity caused by patches of simultaneously active neurons. There are three types of sources in BESA: &lt;br /&gt;
&lt;br /&gt;
* [[Image:singleDipole.png|40px]] [[#Single Dipole | single dipoles]],&lt;br /&gt;
* [[Image:regionalSource.png|40px]] [[#Regional Source | regional sources]],&lt;br /&gt;
* [[Image:spatialComponent.png|40px]] [[#Spatial Component | spatial components]].&lt;br /&gt;
&lt;br /&gt;
In case of MRI-coregistered datasets the [[#Confidence ellipsoid and error rim | confidence ellipsoid and error rim]] can be displayed for single dipoles and regional sources.&lt;br /&gt;
&lt;br /&gt;
== Single Dipole ==&lt;br /&gt;
&lt;br /&gt;
[[Image:singleDipole.png|40px]] A single dipole source (abbreviation: ''SD'' or ''Dip'') can be regarded as an electric current dipole, which is used for the physical modeling of the physiological activity. It is described by a location and an orientation, and the source waveform describes its amplitude over time.&lt;br /&gt;
&lt;br /&gt;
'''Selected Source'''&lt;br /&gt;
&lt;br /&gt;
A source is selected by clicking onto the source plot in the head box or by clicking onto the source waveform in the source box. It is deselected by selecting another source or by clicking beneath any source plot in the head box.&lt;br /&gt;
&lt;br /&gt;
The selected source is marked with a circle around its source plots in the head box, with a golden halo in the 3D window and a colored rectangle around its On/Off and Fit/No fit button in the source box. If a source is selected its parameters are displayed in the parameter box.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Regional Source ==&lt;br /&gt;
&lt;br /&gt;
[[Image:regionalSource.png|40px]] A regional source (abbreviation: ''RS'') is a source which describes all activity originating in the vicinity of its location. It can be regarded as a source with three (MEG spherical head models: two) [[#Single Dipole| single dipoles]] (called components) at the same location but with orthogonal orientations.&lt;br /&gt;
&lt;br /&gt;
[[Image:orientedRegionalSource.png|40px]] A regional source can be rotated such that one of the single orientations of its components explains a maximum of activity at a specified sample. If a regional source has been rotated, the orientation of each component is displayed in the [[Source_Analysis_Functions_of_the_Window#Head_Box | head box]], otherwise only the source body is displayed. (Please refer to the Set Orientation popup menu.)&lt;br /&gt;
&lt;br /&gt;
== Spatial Component ==&lt;br /&gt;
&lt;br /&gt;
[[Image:spatialComponent.png|40px]] A spatial component (abbreviation: ''SpC'') is a source represented by a principal vector. This principal vector results from a Principal Component Analysis (PCA) or Independent Component Analysis (ICA) of the covariance data matrix, from the RAP-Music algorithm, or from the measured data at the cursor sample. It describes the contribution of the source at the sensors. The topography of a spatial component need not be of dipolar nature.&lt;br /&gt;
&lt;br /&gt;
If the spatial component results from a PCA, ICA, or the cursor sample, its location is reconstructed by an approximation. Spatial components created by RAP-Music have exactly defined location and orientation but can consist of two components (with one resulting principal vector).&lt;br /&gt;
&lt;br /&gt;
== Confidence Ellipsoid and Error Rim ==&lt;br /&gt;
''(requires BESA Research 7.1 or higher)''&lt;br /&gt;
&lt;br /&gt;
For [[#DSingle Dipole | dipole solutions]] and [[#Regional Source | oriented regional sources]], confidence limits are calculated, displayed, and stored. The last fit interval used for a source is relevant for computing the confidence limit. This interval is also stored with the solution. In case of multi-dipole solutions or solutions which include spatial components, the full source model is taken into account for computation. Confidence limits are written to solution files if the coordinate system for export is set to Talairach. For these solutions, an import and display of the solution in BESA MRI is possible (BESA MRI 3.0 or higher). The limit that is computed corresponds to the 95% confidence limit. Computation follows the approach of M. Hämäläinen (Interpretation of neuromagnetic measurements: modeling and statistical considerations, PhD thesis at Helsinki University of Technology 1987, pp 27 ff). &lt;br /&gt;
&lt;br /&gt;
* Note: Confidence limit display in the MRI window is only active if an individual MRI was co-registered.&lt;br /&gt;
* Also note that the confidence limit computed requires a baseline interval that is well defined. The baseline interval can be adjusted by clicking on the baseline indicator bar at the top left of the Source Analysis window. &lt;br /&gt;
* Confidence limits depend on many factors including the number of active sources, the signal-to-noise ratio, and the fit interval. In particular, the confidence limit does not account for other errors, e.g. head model errors, co-registration errors, or influence of artifacts on the solution. They should be regarded as a guideline and serve as a lower limit to the confidence of the solution, not as an upper limit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The confidence ellipsoid radii are computed as follows:'''&lt;br /&gt;
&lt;br /&gt;
First the data predicted by the model (b) is computed using fitting time point i or the fitting interval, and predicted source strength from the inverse operator applied to measured data.&lt;br /&gt;
&lt;br /&gt;
ji is calculated for the time point. Then the Jabobian J can be defined as change in b when moving the dipole in the three main axes of the ellipsoid, e.g. for the first axis (depicted as x axis here):&lt;br /&gt;
&lt;br /&gt;
[[Image:confidenceEllipsoid_eq01.png]] &lt;br /&gt;
&lt;br /&gt;
where h is sufficiently small.&lt;br /&gt;
&lt;br /&gt;
Then compute the C matrix (3x3) from which radii (∆x,∆y,∆z) for a 95% confidence interval can be defined:&lt;br /&gt;
&lt;br /&gt;
[[Image:confidenceEllipsoid_eq02.png]] &lt;br /&gt;
&lt;br /&gt;
[[Image:confidenceEllipsoid_eq03.png]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
* Hämäläinen, M., 1987. Interpretation of neuromagnetic measurements : modeling and statistical considerations. Helsinki University of Technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{BESAManualNav}}&lt;/div&gt;</summary>
		<author><name>Mateusz</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-04T12:41:56Z</updated>
		
		<summary type="html">&lt;p&gt;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>Mateusz</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-04T12:24:48Z</updated>
		
		<summary type="html">&lt;p&gt;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 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 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>Mateusz</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-04T12:09:26Z</updated>
		
		<summary type="html">&lt;p&gt;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 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 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 || 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 || 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;
| 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;
| MAINMarkChannels || 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;
| &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;
| 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;
| &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;
| 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;
| &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;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>Mateusz</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-04T11:42:01Z</updated>
		
		<summary type="html">&lt;p&gt;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 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 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;
| GENBatchWindowPosition || 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;
| GENsaveBitmap || save a screenshot of the Source Analysis or the 3D window&lt;br /&gt;
|-&lt;br /&gt;
| SetVariable || 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;
| MAINDefineArtifactTopography || 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;
| MAINExportToBESAConnectivity || 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;
| 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;
| MAINMarkChannels || 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;
| MAINSplineConstant || set the spline constant used in spherical spline maps and channel interpolation&lt;br /&gt;
|-&lt;br /&gt;
| MAINTriggerRecode || 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;
| 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;
| MAINViewChannelType || select the channel type to display, and select channel types for mapping, export, etc&lt;br /&gt;
|-&lt;br /&gt;
| MAINViewSelected || 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;
| 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;
| SAHeadModel || set the head model&lt;br /&gt;
|-&lt;br /&gt;
| SALabelSource || 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;
| SAIMAGEBeamformerTimeDomain || 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>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=File:Batch_processing_(3).png</id>
		<title>File:Batch processing (3).png</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=File:Batch_processing_(3).png"/>
				<updated>2021-05-04T10:15:41Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: Mateusz uploaded a new version of &amp;amp;quot;File:Batch processing (3).png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=File:Batch_processing_(3).png</id>
		<title>File:Batch processing (3).png</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=File:Batch_processing_(3).png"/>
				<updated>2021-05-04T10:15:21Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: Mateusz uploaded a new version of &amp;amp;quot;File:Batch processing (3).png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=File:Batch_commands1.png</id>
		<title>File:Batch commands1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=File:Batch_commands1.png"/>
				<updated>2021-05-04T10:13:17Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Mateusz</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-03T09:17:51Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: /* Data Review and Analysis */&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;
:[[Filtering scope]]&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;
* [[Artifact correction with intracranial channels]]&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>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Filtering_scope</id>
		<title>Filtering scope</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Filtering_scope"/>
				<updated>2021-02-03T08:57:39Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &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 = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
==Overview==&lt;br /&gt;
In EEG/MEG data analysis frequency filtering is one of the most basic and at the same time important operations. In BESA Research filtering is implemented as a linear operation so it is interchangeable in the processing pipeline - it can be changed at every processing step in almost all situations. There are however some moments that filtering cannot be applied in a linear manner - i.e. averaging. In general, we recommend not to apply filtering during such types of operations (apart from high pass to reduce drifts) as it can still be applied afterwards. You will be prompted by the application if you encounter this type of situation in data analysis: &lt;br /&gt;
&lt;br /&gt;
[[File:Filter_notification.jpg]]&lt;br /&gt;
&lt;br /&gt;
Also at some stages of the data processing, filtering is of major importance, therefore we made it more accessible and you can easily redefine it. Please have a look at the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter type&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Review window&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Search Average View&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Averaged buffer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | FFT&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | lienear corelation / regression&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Combine Conditions&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | ERP&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Coherence&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Time Frequency plot&amp;lt;br&amp;gt;(single click)&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | TopViewer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Source Analysis&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Low/High pass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #CFF26B&amp;quot; |SA&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Notch&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Bandpass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Polygraphic&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main* / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  n.a.&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | artifact correction&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px, #CFF26B 10px,#CFF26B 20px);&amp;quot;| Main/SA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Main settings==&lt;br /&gt;
The main setting for artifact correction can be set using '''EdF''' or menu entry '''Filters/Edit Filter Settings'''...&lt;br /&gt;
&lt;br /&gt;
[[File:filter_main.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific ERP settings==&lt;br /&gt;
The ERP filter settings can be set during paradigm definition. Note that there are two different settings - for artifact scan and for averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:filter_ERP.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific Source Analysis settings==&lt;br /&gt;
For source analysis (SA), if you press '''ESI/MSI''' button on the toolbar ribbon ''Main'' filter settings will be used. Filters for SA can be set during sending a block of data to Source Analysis (right-click on the highlighted block and select '''Source Analysis'''). &lt;br /&gt;
&lt;br /&gt;
[[File:filter_SA.jpg]]&lt;br /&gt;
&lt;br /&gt;
In case of enabled artifact correction, you will be prompted just before averaging if you want to average artifact corrected data or not. The detailed description of difference in both approaches can be found [[Using BESA to correct blink and EKG artifacts in MEG data#Averaging the raw data|here]]&lt;br /&gt;
&lt;br /&gt;
==Notch filter==&lt;br /&gt;
Note that because of its generic nature - power line artifact removal - the notch filter is treated differently. The notch filter value populates from ''Main'' setting to all subsequent applications.&lt;br /&gt;
&lt;br /&gt;
==Bandpass filter==&lt;br /&gt;
The bandpass filter is complementary to the high/low pass filter combination. For convenience, it is treated differently (it also has different filter characteristics) and also populates to all subsequent applications from ''Main'' setting.&lt;br /&gt;
&lt;br /&gt;
==Polygraphic filter==&lt;br /&gt;
Polygraphic channels are filtered using Main settings. Note that there are additional settings that can be applied to the polygraphic filter accessible via '''Filters/Polygraphic/Additional Chans...'''&lt;br /&gt;
&lt;br /&gt;
[[File:filter_poly.jpg]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Review#Filtering|Filtering]]&lt;br /&gt;
*[[Using BESA to correct blink and EKG artifacts in MEG data]]&lt;br /&gt;
*[[Pipeline for simultaneous EEG-fMRI recording]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Filtering_scope</id>
		<title>Filtering scope</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Filtering_scope"/>
				<updated>2021-02-03T08:35:19Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &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 = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
==Overview==&lt;br /&gt;
In EEG/MEG data analysis frequency filtering is one of the most basic and at the same time important operations. In BESA Research filtering is implemented as a linear operation so it is interchangeable in the processing pipeline - it can be changed at every processing step in almost all situations. There are however some moments that filtering cannot be applied in a linear manner - i.e. averaging. In general, we recommend not to apply filtering during such types of operations (apart from high pass to reduce drifts) as it can still be applied afterwards. You will be prompted by the application if you encounter this type of situation in data analysis: &lt;br /&gt;
&lt;br /&gt;
[[File:Filter_notification.jpg]]&lt;br /&gt;
&lt;br /&gt;
Also at some stages of the data processing, filtering is of major importance, therefore we made it more accessible and you can easily redefine it. Please have a look at the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter type&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Review window&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Search Average View&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Averaged buffer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | FFT&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | lienear corelation / regression&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Combine Conditions&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | ERP&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Coherence&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Time Frequency plot&amp;lt;br&amp;gt;(single click)&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | TopViewer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Source Analysis&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Low/High pass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #CFF26B&amp;quot; |SA&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Notch&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Bandpass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Polygraphic&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main* / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  n.a.&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | artifact correction&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px, #CFF26B 10px,#CFF26B 20px);&amp;quot;| Main/SA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Main settings==&lt;br /&gt;
The main setting for artifact correction can be set using '''EdF''' or menu entry '''Filters/Edit Filter Settings'''...&lt;br /&gt;
&lt;br /&gt;
[[File:filter_main.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific ERP settings==&lt;br /&gt;
The ERP filter settings can be set during paradigm definition. Note that there are two different settings - for artifact scan and for averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:filter_ERP.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific Source Analysis settings==&lt;br /&gt;
For source analysis (SA), if you press '''ESI/MSI''' button on the toolbar ribbon ''Main'' filter settings will be used.) Filters for SA can be set during sending a block of data to Source Analysis (right-click on the highlighted block and select '''Source Analysis'''). &lt;br /&gt;
&lt;br /&gt;
[[File:filter_SA.jpg]]&lt;br /&gt;
&lt;br /&gt;
In case of enabled artifact correction, you will be prompted just before averaging if you want to average artifact corrected data or not. The detailed description of difference in both approaches can be found [[Using BESA to correct blink and EKG artifacts in MEG data#Averaging the raw data|here]]&lt;br /&gt;
&lt;br /&gt;
==Notch filter==&lt;br /&gt;
Note that because of its generic nature - power line artifact removal - the notch filter is treated differently. The notch filter value populates from ''Main'' setting to all subsequent applications.&lt;br /&gt;
&lt;br /&gt;
==Bandpass filter==&lt;br /&gt;
The bandpass filter is complementary to the high/low pass filter combination. For convenience, it is treated differently (it also has different filter characteristics) and also populates to all subsequent applications from ''Main'' setting.&lt;br /&gt;
&lt;br /&gt;
==Polygraphic filter==&lt;br /&gt;
Polygraphic channels are filtered using Main settings. Note that there are additional settings that can be applied to the polygraphic filter accessible via '''Filters/Polygraphic/Additional Chans...'''&lt;br /&gt;
&lt;br /&gt;
[[File:filter_poly.jpg]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Review#Filtering|Filtering]]&lt;br /&gt;
*[[Using BESA to correct blink and EKG artifacts in MEG data]]&lt;br /&gt;
*[[Pipeline for simultaneous EEG-fMRI recording]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Filtering_scope</id>
		<title>Filtering scope</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Filtering_scope"/>
				<updated>2021-02-03T08:33:45Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &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 = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In EEG/MEG data analysis frequency filtering is one of the most basic and at the same time important operations. In BESA Research filtering is implemented as a linear operation so it is interchangeable in the processing pipeline - it can be changed at every processing step in almost all situations. There are however some moments that filtering cannot be applied in a linear manner - i.e. averaging. In general, we recommend not to apply filtering during such types of operations (apart from high pass to reduce drifts) as it can still be applied afterwards. You will be prompted by the application if you encounter this type of situation in data analysis: &lt;br /&gt;
&lt;br /&gt;
[[File:Filter_notification.jpg]]&lt;br /&gt;
&lt;br /&gt;
Also at some stages of the data processing, filtering is of major importance, therefore we made it more accessible and you can easily redefine it. Please have a look at the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter type&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Review window&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Search Average View&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Averaged buffer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | FFT&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | lienear corelation / regression&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Combine Conditions&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | ERP&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Coherence&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Time Frequency plot&amp;lt;br&amp;gt;(single click)&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | TopViewer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Source Analysis&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Low/High pass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #CFF26B&amp;quot; |SA&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Notch&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Bandpass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Polygraphic&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main* / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  n.a.&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | artifact correction&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px, #CFF26B 10px,#CFF26B 20px);&amp;quot;| Main/SA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Main settings==&lt;br /&gt;
The main setting for artifact correction can be set using '''EdF''' or menu entry '''Filters/Edit Filter Settings'''...&lt;br /&gt;
&lt;br /&gt;
[[File:filter_main.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific ERP settings==&lt;br /&gt;
The ERP filter settings can be set during paradigm definition. Note that there are two different settings - for artifact scan and for averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:filter_ERP.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific Source Analysis settings==&lt;br /&gt;
For source analysis (SA), if you press '''ESI/MSI''' button on the toolbar ribbon ''Main'' filter settings will be used.) Filters for SA can be set during sending a block of data to Source Analysis (right-click on the highlighted block and select '''Source Analysis'''). &lt;br /&gt;
&lt;br /&gt;
[[File:filter_SA.jpg]]&lt;br /&gt;
&lt;br /&gt;
In case of enabled artifact correction, you will be prompted just before averaging if you want to average artifact corrected data or not. The detailed description of difference in both approaches can be found [[Using BESA to correct blink and EKG artifacts in MEG data#Averaging the raw data|here]]&lt;br /&gt;
&lt;br /&gt;
==Notch filter==&lt;br /&gt;
Note that because of its generic nature - power line artifact removal - the notch filter is treated differently. The notch filter value populates from ''Main'' setting to all subsequent applications.&lt;br /&gt;
&lt;br /&gt;
==Bandpass filter==&lt;br /&gt;
The bandpass filter is complementary to the high/low pass filter combination. For convenience, it is treated differently (it also has different filter characteristics) and also populates to all subsequent applications from ''Main'' setting.&lt;br /&gt;
&lt;br /&gt;
==Polygraphic filter==&lt;br /&gt;
Polygraphic channels are filtered using Main settings. Note that there are additional settings that can be applied to the polygraphic filter accessible via '''Filters/Polygraphic/Additional Chans...'''&lt;br /&gt;
&lt;br /&gt;
[[File:filter_poly.jpg]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Review#Filtering|Filtering]]&lt;br /&gt;
*[[Using BESA to correct blink and EKG artifacts in MEG data]]&lt;br /&gt;
*[[Pipeline for simultaneous EEG-fMRI recording]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Filtering_scope</id>
		<title>Filtering scope</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Filtering_scope"/>
				<updated>2021-02-03T08:33:05Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &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 = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In EEG/MEG data analysis frequency filtering is one of the most basic and at the same time important operations. In BESA Research filtering is implemented as a linear operation so it is interchangeable in the processing pipeline - it can be changed at every processing step in almost all situations. There are however some moments that filtering cannot be applied in a linear manner - i.e. averaging. In general, we recommend not to apply filtering during such types of operations (apart from high pass to reduce drifts) as it can still be applied afterwards. You will be prompted by the application if you encounter this type of situation in data analysis: &lt;br /&gt;
&lt;br /&gt;
[[File:Filter_notification.jpg]]&lt;br /&gt;
&lt;br /&gt;
Also at some stages of the data processing, filtering is of major importance, therefore we made it more accessible and you can easily redefine it. Please have a look at the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter type&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Review window&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Search Average View&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Averaged buffer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | FFT&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | lienear corelation / regression&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Combine Conditions&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | ERP&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Coherence&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Time Frequency plot&amp;lt;br&amp;gt;(single click)&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | TopViewer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Source Analysis&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Low/High pass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #CFF26B&amp;quot; |SA&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Notch&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Bandpass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Polygraphic&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main* / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  n.a.&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | artifact correction&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px, #CFF26B 10px,#CFF26B 20px);&amp;quot;| Main/SA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Main settings==&lt;br /&gt;
The main setting for artifact correction can be set using '''EdF''' or menu entry '''Filters/Edit Filter Settings'''...&lt;br /&gt;
&lt;br /&gt;
[[File:filter_main.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific ERP settings==&lt;br /&gt;
The ERP filter settings can be set during paradigm definition. Note that there are two different settings - for artifact scan and for averaging.&lt;br /&gt;
&lt;br /&gt;
[[File:filter_ERP.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific Source Analysis settings==&lt;br /&gt;
For source analysis (SA), if you press ''''ESI/MSI''' button on the toolbar ribbon ''Main'' filter settings will be used.) Filters for SA can be set during sending a block of data to Source Analysis (right-click on the highlighted block and select '''Source Analysis'''). &lt;br /&gt;
&lt;br /&gt;
[[File:filter_SA.jpg]]&lt;br /&gt;
&lt;br /&gt;
In case of enabled artifact correction, you will be prompted just before averaging if you want to average artifact corrected data or not. The detailed description of difference in both approaches can be found [[Using BESA to correct blink and EKG artifacts in MEG data#Averaging the raw data|here]]&lt;br /&gt;
&lt;br /&gt;
==Notch filter==&lt;br /&gt;
Note that because of its generic nature - power line artifact removal - the notch filter is treated differently. The notch filter value populates from ''Main'' setting to all subsequent applications.&lt;br /&gt;
&lt;br /&gt;
==Bandpass filter==&lt;br /&gt;
The bandpass filter is complementary to the high/low pass filter combination. For convenience, it is treated differently (it also has different filter characteristics) and also populates to all subsequent applications from ''Main'' setting.&lt;br /&gt;
&lt;br /&gt;
==Polygraphic filter==&lt;br /&gt;
Polygraphic channels are filtered using Main settings. Note that there are additional settings that can be applied to the polygraphic filter accessible via '''Filters/Polygraphic/Additional Chans...'''&lt;br /&gt;
&lt;br /&gt;
[[File:filter_poly.jpg]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Review#Filtering|Filtering]]&lt;br /&gt;
*[[Using BESA to correct blink and EKG artifacts in MEG data]]&lt;br /&gt;
*[[Pipeline for simultaneous EEG-fMRI recording]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Filtering_scope</id>
		<title>Filtering scope</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Filtering_scope"/>
				<updated>2021-02-02T16:17:06Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &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 = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In EEG/MEG data analysis frequency filtration is one of the most basic and at the same time important operations. In BESA Research filtration is implemented as a linear operation so it is interchangeable in the processing pipeline - it can be changed at every processing step in almost all situations. There are however some moments that filtration cannot be applied in a linear manner - i.e. averaging. In general, we recommend not apply filtration during such types of operations as it can be replied afterward. You will be prompted by the application if you encounter such a moment in data analysis: &lt;br /&gt;
&lt;br /&gt;
[[File:Filter_notification.jpg]]&lt;br /&gt;
&lt;br /&gt;
Also at some stages of the data processing, the filtration is of major importance, therefore we made it more accessible and you can easily redefine it. Please have a look at the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter type&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Review window&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Search Average View&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Averaged buffer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | FFT&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | lienear corelation / regression&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Combine Conditions&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | ERP&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Coherence&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Time Frequency plot&amp;lt;br&amp;gt;(single click)&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | TopViewer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Source Analysis&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Low/High pass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #CFF26B&amp;quot; |SA&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Notch&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Bandpass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Polygraphic&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main* / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  n.a.&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | artifact correction&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px, #CFF26B 10px,#CFF26B 20px);&amp;quot;| Main/SA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Main settings==&lt;br /&gt;
The main setting for artifact correction can be set using '''EdF''' or menu entry '''Filters/Edit Filter Settings'''...&lt;br /&gt;
&lt;br /&gt;
[[File:filter_main.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific ERP settings==&lt;br /&gt;
The ERP filter settings can be set during paradigm definition. Note that there are two different settings - for artifact scan and for averaging&lt;br /&gt;
&lt;br /&gt;
[[File:filter_ERP.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific Source Analysis settings==&lt;br /&gt;
For source analysis (SA), if you press ''''ESI/MSI''' button on the toolbar ribbon ''Main'' filter settings will be used.) Filters for SA can be set during sending a block of data to Source Analysis (right-click on the highlighted block and select '''Source Analysis'''). &lt;br /&gt;
&lt;br /&gt;
[[File:filter_SA.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Notch filter==&lt;br /&gt;
Note that because of its generic nature - power line artifact removal - notch filter is treated differently. The notch filter value populates from ''Main'' setting to all subsequent applications.&lt;br /&gt;
&lt;br /&gt;
==Bandpass filter==&lt;br /&gt;
Bandpass filter is complementary to high/low pass filter combination. For convenience, it is treated differently and also populates to all subsequent applications from ''Main'' setting.&lt;br /&gt;
&lt;br /&gt;
==Polygraphic filter==&lt;br /&gt;
Polygraphic channels are filtered using Main settings. Note that there are additional settings that can be applied to the polygraphic filter accessible via '''Filters/Polygraphic/Additional Chans...'''&lt;br /&gt;
&lt;br /&gt;
[[File:filter_poly.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Filtering_scope</id>
		<title>Filtering scope</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Filtering_scope"/>
				<updated>2021-02-02T16:15:28Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: &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 = 6.1 or higher&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In EEG/MEG data analysis frequency filtration is one of the most basic and at the same time important operations. In BESA Research filtration is implemented as a linear operation so it is interchangeable in the processing pipeline - it can be changed at every processing step in almost all situations. There are however some moments that filtration cannot be applied in a linear manner - i.e. averaging. In general, we recommend not apply filtration during such types of operations as it can be replied afterward. You will be prompted by the application if you encounter such a moment in data analysis: &lt;br /&gt;
&lt;br /&gt;
[[File:Filter_notification.jpg]]&lt;br /&gt;
&lt;br /&gt;
Also at some stages of the data processing, the filtration is of major importance, therefore we made it more accessible and you can easily redefine it. Please have a look at the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter type&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Review window&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Search Average View&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Averaged buffer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | FFT&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | lienear corelation/regression&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Combine Conditions&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | ERP&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Coherence&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Time Frequency plot (single click)&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | TopViewer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Source Analysis&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Low/High pass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #CFF26B&amp;quot; |SA&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Notch&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Bandpass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Polygraphic&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main* / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  n.a.&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | artifact correction&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px, #CFF26B 10px,#CFF26B 20px);&amp;quot;| Main/SA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Main settings==&lt;br /&gt;
The main setting for artifact correction can be set using '''EdF''' or menu entry '''Filters/Edit Filter Settings'''...&lt;br /&gt;
&lt;br /&gt;
[[File:filter_main.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific ERP settings==&lt;br /&gt;
The ERP filter settings can be set during paradigm definition. Note that there are two different settings - for artifact scan and for averaging&lt;br /&gt;
&lt;br /&gt;
[[File:filter_ERP.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific Source Analysis settings==&lt;br /&gt;
For source analysis (SA), if you press ''''ESI/MSI''' button on the toolbar ribbon ''Main'' filter settings will be used.) Filters for SA can be set during sending a block of data to Source Analysis (right-click on the highlighted block and select '''Source Analysis'''). &lt;br /&gt;
&lt;br /&gt;
[[File:filter_SA.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Notch filter==&lt;br /&gt;
Note that because of its generic nature - power line artifact removal - notch filter is treated differently. The notch filter value populates from ''Main'' setting to all subsequent applications.&lt;br /&gt;
&lt;br /&gt;
==Bandpass filter==&lt;br /&gt;
Bandpass filter is complementary to high/low pass filter combination. For convenience, it is treated differently and also populates to all subsequent applications from ''Main'' setting.&lt;br /&gt;
&lt;br /&gt;
==Polygraphic filter==&lt;br /&gt;
Polygraphic channels are filtered using Main settings. Note that there are additional settings that can be applied to the polygraphic filter accessible via '''Filters/Polygraphic/Additional Chans...'''&lt;br /&gt;
&lt;br /&gt;
[[File:filter_poly.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Filtering_scope</id>
		<title>Filtering scope</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Filtering_scope"/>
				<updated>2021-02-02T16:15:15Z</updated>
		
		<summary type="html">&lt;p&gt;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;
In EEG/MEG data analysis frequency filtration is one of the most basic and at the same time important operations. In BESA Research filtration is implemented as a linear operation so it is interchangeable in the processing pipeline - it can be changed at every processing step in almost all situations. There are however some moments that filtration cannot be applied in a linear manner - i.e. averaging. In general, we recommend not apply filtration during such types of operations as it can be replied afterward. You will be prompted by the application if you encounter such a moment in data analysis: &lt;br /&gt;
&lt;br /&gt;
[[File:Filter_notification.jpg]]&lt;br /&gt;
&lt;br /&gt;
Also at some stages of the data processing, the filtration is of major importance, therefore we made it more accessible and you can easily redefine it. Please have a look at the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter type&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Review window&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Search Average View&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Averaged buffer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | FFT&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | lienear corelation/regression&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Combine Conditions&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | ERP&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Coherence&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Time Frequency plot (single click)&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | TopViewer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Source Analysis&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Low/High pass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #CFF26B&amp;quot; |SA&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Notch&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Bandpass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Polygraphic&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main* / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  n.a.&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | artifact correction&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px, #CFF26B 10px,#CFF26B 20px);&amp;quot;| Main/SA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Main settings==&lt;br /&gt;
The main setting for artifact correction can be set using '''EdF''' or menu entry '''Filters/Edit Filter Settings'''...&lt;br /&gt;
&lt;br /&gt;
[[File:filter_main.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific ERP settings==&lt;br /&gt;
The ERP filter settings can be set during paradigm definition. Note that there are two different settings - for artifact scan and for averaging&lt;br /&gt;
&lt;br /&gt;
[[File:filter_ERP.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific Source Analysis settings==&lt;br /&gt;
For source analysis (SA), if you press ''''ESI/MSI''' button on the toolbar ribbon ''Main'' filter settings will be used.) Filters for SA can be set during sending a block of data to Source Analysis (right-click on the highlighted block and select '''Source Analysis'''). &lt;br /&gt;
&lt;br /&gt;
[[File:filter_SA.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Notch filter==&lt;br /&gt;
Note that because of its generic nature - power line artifact removal - notch filter is treated differently. The notch filter value populates from ''Main'' setting to all subsequent applications.&lt;br /&gt;
&lt;br /&gt;
==Bandpass filter==&lt;br /&gt;
Bandpass filter is complementary to high/low pass filter combination. For convenience, it is treated differently and also populates to all subsequent applications from ''Main'' setting.&lt;br /&gt;
&lt;br /&gt;
==Polygraphic filter==&lt;br /&gt;
Polygraphic channels are filtered using Main settings. Note that there are additional settings that can be applied to the polygraphic filter accessible via '''Filters/Polygraphic/Additional Chans...'''&lt;br /&gt;
&lt;br /&gt;
[[File:filter_poly.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=Filtering_scope</id>
		<title>Filtering scope</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=Filtering_scope"/>
				<updated>2021-02-02T16:14:49Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: Created page with &amp;quot;{{BESAInfobox |title = Module information |module = BESA Research Standard or higher |version = 6.1 or higher }}  In EEG/MEG data analysis frequency filtration is one of the m...&amp;quot;&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;
In EEG/MEG data analysis frequency filtration is one of the most basic and at the same time important operations. In BESA Research filtration is implemented as a linear operation so it is interchangeable in the processing pipeline - it can be changed at every processing step in almost all situations. There are however some moments that filtration cannot be applied in a linear manner - i.e. averaging. In general, we recommend not apply filtration during such types of operations as it can be replied afterward. You will be prompted by the application if you encounter such a moment in data analysis: &lt;br /&gt;
&lt;br /&gt;
[[File:Filter_notification.jpg]]&lt;br /&gt;
&lt;br /&gt;
Also at some stages of the data processing, the filtration is of major importance, therefore we made it more accessible and you can easily redefine it. Please have a look at the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Filter type&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Review window&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Search Average View&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Averaged buffer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | FFT&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | lienear corelation/regression&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Combine Conditions&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | ERP&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Coherence&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Time Frequency plot (single click)&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | TopViewer&lt;br /&gt;
! style=&amp;quot;font-weight: bold;&amp;quot; | Source Analysis&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Low/High pass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #CFF26B&amp;quot; |SA&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Notch&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Bandpass&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | Polygraphic&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main* / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  None&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main*&lt;br /&gt;
|  n.a.&lt;br /&gt;
|-&lt;br /&gt;
|  style=&amp;quot;font-weight: bold;&amp;quot; | artifact correction&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
| style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px,   #BA9588 10px,   #BA9588 20px);&amp;quot;| Main / can be redefine to default values(2-35Hz) &lt;br /&gt;
|  style=&amp;quot;background: #BA9588&amp;quot; |as used during buffer creation&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #6BCFF2&amp;quot; |ERP&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: #F2D16B&amp;quot; |Main&lt;br /&gt;
|  style=&amp;quot;background: repeating-linear-gradient(45deg, #F2D16B,#F2D16B 10px, #CFF26B 10px,#CFF26B 20px);&amp;quot;| Main/SA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Main settings==&lt;br /&gt;
The main setting for artifact correction can be set using '''EdF''' or menu entry '''Filters/Edit Filter Settings'''...&lt;br /&gt;
&lt;br /&gt;
[[File:filter_main.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific ERP settings==&lt;br /&gt;
The ERP filter settings can be set during paradigm definition. Note that there are two different settings - for artifact scan and for averaging&lt;br /&gt;
&lt;br /&gt;
[[File:filter_ERP.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Specific Source Analysis settings==&lt;br /&gt;
For source analysis (SA), if you press ''''ESI/MSI''' button on the toolbar ribbon ''Main'' filter settings will be used.) Filters for SA can be set during sending a block of data to Source Analysis (right-click on the highlighted block and select '''Source Analysis'''). &lt;br /&gt;
&lt;br /&gt;
[[File:filter_SA.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Notch filter==&lt;br /&gt;
Note that because of its generic nature - power line artifact removal - notch filter is treated differently. The notch filter value populates from ''Main'' setting to all subsequent applications.&lt;br /&gt;
&lt;br /&gt;
==Bandpass filter==&lt;br /&gt;
Bandpass filter is complementary to high/low pass filter combination. For convenience, it is treated differently and also populates to all subsequent applications from ''Main'' setting.&lt;br /&gt;
&lt;br /&gt;
==Polygraphic filter==&lt;br /&gt;
Polygraphic channels are filtered using Main settings. Note that there are additional settings that can be applied to the polygraphic filter accessible via '''Filters/Polygraphic/Additional Chans...'''&lt;br /&gt;
&lt;br /&gt;
[[File:filter_poly.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Preprocessing]]&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	<entry>
		<id>https://wiki.besa.de/index.php?title=File:Filter_poly.jpg</id>
		<title>File:Filter poly.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.besa.de/index.php?title=File:Filter_poly.jpg"/>
				<updated>2021-02-02T16:13:20Z</updated>
		
		<summary type="html">&lt;p&gt;Mateusz: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Mateusz</name></author>	</entry>

	</feed>