BrainStreamDataSources

From TSG Doc
Jump to navigation Jump to search

Connecting Data Sources

Data sources can be hardware devices, data files stored on disk or simulated data. BrainStream can connect to any of these data sources via a [FieldTrip buffer].

85x

Figure 1: BrainStream is connected to data sources via a FieldTrip buffer.

The connection between BrainStream and the FieldTrip buffer is always the same. In order to switch between data sources, you need to connect the new data source to the FieldTrip buffer. You can do this by specifying the data source in the block file.

Hardware devices

Any acquisition system supported by the FieldTrip toolbox can be used as a data source within BrainStream. For more information about setting up hardware devices for the first time, see the Installation Guide. In the block file, you can specify a hardware device as data source as follows:

[DataSources]
<datasource> = '<buffer address>:<port>:<device>'   

<datasource> = name that you want to give the data source. In this documentation, we often call our data source 'eeg'
<buffer address> = address of the FieldTrip buffer
<port> = port
<device> = name of the hardware device

Some examples:
eeg = 'buffer://localhost:1972:biosemi_active2'
nirs = 'buffer://localhost:1972:artinis_oxymon'
fmri = 'buffer://localhost:1972:siemens_fmri'

Configuring acquisition-related settings

Usually, default configuration settings will be specified for your hardware systems when they are first set up (see the [.DocsSectionsInstallation#HardwareSetup Installation Guide]). Most of the time you will not have to use other settings than the defaults. However, if you do want to change certain settings you can do this via the block file.

The connection between specific hardware devices and the FieldTrip buffer is controlled by interfacing software. For most hardware systems, the interfacing software uses a configuration file in which some acquisition-related settings are specified. For example, configuration files for the BioSemi system specify from how many channels data should be recorded, and whether the data should be downsampled. If you want to use another configuration than the default and the interfacing software supports FieldTrip's Online Data Manager, you can specify another configuration file in your block file. The configuration file specified in the block file will then be used instead of the one specified at startup. In order to do this, you must specify some settings under topic [<device>]:

[biosemi_active2]                           %the [[BioSemi|Bio Semi]] active 2 system is used
OnlineDataManager = 1;                      %indicate that the Online Data Manager will be used
configureFile = 'biosemi_active2_cap64.cfg; %alternative configuration file with 64 EEG electrodes 

For more information about configuration files for different acquisition systems, see the [FieldTrip website].

Recorded data files (file proxies)

It is also possible to use a data file that was recorded previously as a data source. In the block file, you can specify this as follows:

[DataSources]
<datasource> = '<data file>:<device>' 

<datasource> = name that you want to give the data source. In this documentation, we often call our data source 'eeg'
<data file> = name of the data file
<device> = name of the hardware device with which the data was recorded

For example:
eeg = 'data/myeeg.bdf:biosemi_active2'

Simulated data

When you are designing experiments, it may be useful to use simulated instead of actually recorded data. You can specify a simulated data source as follows:

[DataSources]
<datasource> = 'simulate:<device>'

<datasource> = name that you want to give the data source. In this documentation, we often call our data source 'eeg'
<device> = name of the hardware device to simulate data for

For example:
eeg = 'simulate:biosemi_active2'