Exports for all occasions – A selective overview of Analyzer 2’s most useful export options

by Michael Hoppstädter
Scientific Consultant (Brain Products)

Logo AnalyzerBrainVision Analyzer 2 offers some nice export options that will suit (almost) every need for external processing. This article will summarize the most important routes out of Analyzer 2 and give some examples of how to use them within your own analysis.

There are many good reasons to stick with Analyzer 2’s easy to handle signal processing functions and its manifold view options for your data analysis. However, you will often reach a point in your analysis pipeline where you might have to export your data – be it for a thorough statistical evaluation or to use an external signal processing tool. The very good news is that this can easily be done. In the following, we will first have a look on the functions that are commonly used to export peak or area measures from your averaged ERP waveforms or frequency spectra. The second part of the article is devoted to the options that allow you to export single trial measures from time, frequency or time-frequency domain data. The third part explains how you can export a whole dataset. The final part concludes with information about graphics and marker export.

Export aggregated data across subjects

Imagine a typical ERP analysis, beginning with an assessment of data quality, some preprocessing to reduce noise and eventually reaching the point of segmenting your conditions into time-locked epochs. The end of this pipeline will then be the average waveform of an experimental condition. Since neuroscientists are usually not happy with only looking at the averages of different conditions but rather want to statistically assess the significance of between-condition effects, it is necessary to export the desired information for statistical evaluation. BrainVision Analyzer 2 has two modules that are able to export aggregated measures such as latency or average amplitudes across subjects to a text file that can then be further processed. The output file is structured as a data matrix with one subject per row and the requested measure per channel as a column vector. Thus, it has good compatibility with programs like MATLAB, R, Microsoft Excel or SPSS that use matrix representations.

One of the modules to export aggregated measures is the Area Information Export. This works for both time and frequency domain data. It can be used to export aggregated measures such as area under the curve, mean amplitude, or raw sum of spectral lines from a defined time window or frequency band.

The second module of this class is the Peak Information Export. It can be used to export the amplitude around a waveform peak and/or the peak latency. However, to run this module, it is required that the peaks are tagged with markers. This can for example be done with the transformation Peak Detection. The resulting text file can list the requested measure(s) for all channels that contain the specified peak marker.

Since both modules work across subjects it is required that the History Node from which the information should be exported is named identically for all subjects. A nice feature of both export options is that data from several History Nodes can be exported simultaneously (see Figure 1). Please note that both Area Information Export and Peak Information Export were designed to work exclusively with averaged data.

Exports for all occasions – A selective overview of Analyzer 2’s most useful export options

Figure 1: The Peak Information Export can be used to export amplitude and latency information of a defined waveform peak in one or several experimental conditions across multiple subjects.

Export single trial data from individual subjects

Analyzer 2 offers extended signal processing options in the form of Solutions. This also holds when it comes to the evaluation of single trial data. If you need to output some data parameters from each individual trial, there are three dedicated export solutions, one for each data domain supported in Analyzer 2. If the Solutions are not yet installed in Analyzer 2, you can download them from the Brain Products website.

The Peak Export solution is the analogue of Peak Information and Area Information Export for single trial time domain data. It can be used to derive peak related measures like peak latency and amplitude or area under the curve around a peak or between two peaks. As for the Peak Information Export, peak detection with a dedicated solution (MinMax Markers) has to be carried out on the single trial level. This pipeline can also be used to locate and export frequency peaks in frequency domain data. The Peak Export solution can also be used to export area under the curve or mean voltage from within a specified time interval.

The single trial equivalent to Area Information Export in the frequency domain is the FFT Band Export solution. It is possible to specify a frequency band that will be exported for each channel in each trial. In addition to area under curve, mean amplitude or the raw sum of spectral values, this module also allows you to normalize output.

Lastly, the Wavelet Data Export solution can be applied to time-frequency data that was generated by using continuous real or complex valued Morlet wavelets with a logarithmic spacing between wavelet layers. While the time range can be flexibly specified, the frequency range has to be bounded by a lower and upper wavelet layer. Real or complex wavelet values can be exported either as cumulative sum or as the average over all data points in the selected time-frequency plane.

These solutions operate on an individual subject level but when used within a history template, they can also be used to compile the information across subjects. In the case of Peak Export and Wavelet Data Export, it is also possible to check the option to append the data to the output file each time a new subject is processed so that you will end up with a single result file for all your subjects.

Export individual data sample-by-sample

Sometimes it can be necessary to export a dataset in its entirety instead of extracting any peak or area measures. It might be that you want to further process your data in another software package or that you want to have the whole time / frequency series flexibly at hand for statistics.

BrainVision Analyzer 2 offers a module exactly for this purpose, namely the Generic Data Export, which works on time domain, frequency domain or time-frequency domain data. This export function generates a new data file which is either binary or ASCII coded. If the goal is, for example, to load data in the MATLAB-based signal processing tools EEGLAB or FieldTrip, the Generic Data Export can be used to generate new files in the BrainVision native format which consists of a data, a header and a marker file. Many other signal processing tools have integrated routines to read this format through the header file. An alternative way to get your data into Matlab which makes especially sense if you want to reimport them into Analyzer 2, is the Matlab Transformation. If you want to know more about this great tool, please check the article “Matlab transform fundamentals”.

To generate files in BrainVision native format with the Generic Data Export, it is sufficient to check the boxes to write header and marker files in text format on the first page of the transformation’s dialogue and to enter the appropriate file extension for the data file (*.eeg or *.dat; see Figure 2).

Exports for all occasions – A selective overview of Analyzer 2’s most useful export options

Figure 2: Selection of options to create an export in BrainVision native format with Generic Data Export. The usage of placeholders enables you to automatically adapt filename generation to each dataset when the node is applied to other History Files as part of a History Template.

The second page of the dialogue gives the possibility to decide if the data file should be written binary or in ASCII code. This is an important option since binary data generally has the advantage that it needs less disk space and can be loaded and saved faster but if the data should be readable in a text editor you should not select the binary option. This is for example mandatory for SPSS or Microsoft Excel. In this case it is of course not necessary to write header and marker files. Another important option is the data orientation, which can be either multiplexed (one row per sampling point, one column per channel; see Figure 3) or vectorized (one row per channel, one column per sampling point).

The Generic Data Export is also the way to go to export your time or time-frequency domain data to BESA Statistics 2.0. If you would like to know more about how to interface between Analyzer 2 and BESA Statistics, there is a Support Tip “Non-parametric permutation statistics made easy – Analyzer 2 and BESA Statistics 2.0”.

For time domain data, you can restrict the amount of data points to a certain time range if you do not want to export the whole dataset (e.g. because you have many sampling points). Just mark a portion of data with the cursor (or use the right-click option Selected Area Settings) and the export can be limited to the marked area by selecting Export Selected Block on the first page of Generic Data Export.

Exports for all occasions – A selective overview of Analyzer 2’s most useful export options

Figure 3: Structure of Generic Data Export output files according to the input data format. The displayed configuration is generated when using text export together with multiplexed data orientation.

You might want to export a History Node and reuse the newly created raw data files again in the same Analyzer 2 workspace, for example, to use the data as the starting point of a new analysis or to append datasets from different branches within a subject’s history tree. There is a dedicated module in Analyzer 2 which does not require more than two clicks to achieve this goal, namely the Create New Dataset. If you want to read more about this handy tool, please refer to the Support Tip “Create New Dataset”.

In some cases, you might want to use an external tool that cannot read the BrainVision format or an ASCII format text file. For this case, Analyzer 2 also offers the possibility to do an EDF Export which is a standard format that can be read by many programs. You have the possibility to save only data points (EDF) or data points and marker information (EDF+).

Export graphics

Since BrainVision Analyzer 2 offers a bunch of fast and customizable views, you might also be interested to generate and export graphics for direct use in presentations or publications or for further processing in any image editing software. All graphics can be customized using either the View-Settings menu (permanent) or the right-click option Settings of […] view (only for the current graphic). There are possibilities to adjust waveform thickness in Overlays, to change the colour scheme of Maps or to adapt Styles of figure labels, just to give some examples. To export your graphics (permanent or transient views), you can either use the option Print to Graphics from the Analyzer 2 ribbon (exports all currently displayed views) or select via right-click Save as File (exports only the active view). You can choose between common raster image formats and a meta file format that is also suitable for image editing using vector graphics. You can set your personal preferences for e.g. image orientation or resolution in the Analyzer 2 Preferences menu where you can find a dedicated tab for Graphics Export/Output. Should you prefer creating your own layout though, you can of course always use the Generic Data Export to export all your data samples into a matrix format to generate graphics in MATLAB or R.

Export markers

Sometimes it might not be the data points but the marker information that you want to process externally (e.g. using Microsoft Excel or any text editor). For this purpose, Analyzer 2 offers a dedicated Markers Export where either all or only a selection of markers can be exported to a text or XML file.

Concluding remarks

As you can see, there are lots of different export options in BrainVision Analyzer 2 of which we covered the most important ones above. Taking advantage of these will in most cases suit all your needs for external processing of various data formats. You can find a more extended documentation of all of the export routines either in the Analyzer 2 User Manual or, in case of the solutions, directly in Analyzer 2 in the Solutions Help. If you have further questions regarding the use of Analyzer 2’s export options, you can pose them anytime via email.