Difference: DocsSectionsInstallation (1 vs. 13)

Revision 1311 Nov 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Line: 128 to 128
 Note: If your function for sending out markers requires specific resources (both software and hardware), they should also be installed at every connected client. In your experiment design insert a marker from the BS_INIT processing pipeline and define it to execute on the client, which actions then should install required software resources.

Firewall settings

Changed:
<
<
BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further to connect to buffers streaming data (either acquired, simulated, or from file), or to install buffers related to BrainStream's pre-processing option. Make sure these ports are not blocked by your firewall.
>
>
BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further (up to numbers between 1985-1990) to connect to buffers streaming data (either acquired, simulated, or from file), to install external Matlab modules, or to install buffers related to BrainStream's pre-processing option. Make sure these ports are not blocked by your firewall.
 
META FILEATTACHMENT attachment="buffer.png" attr="" comment="" date="1324026657" name="buffer.png" path="buffer.png" size="134408" stream="buffer.png" tmpFilename="/var/tmp/CGItemp55954" user="MarjoleinVanDerWaal" version="1"

Revision 1211 Nov 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Line: 9 to 9
  BrainStream requires Matlab version 2008a or higher. The availability of this license depends on your institution's licensing agreements with MathWorks. BrainStream also requires Matlab's Signal Processing Toolbox.

Ensure access to BrainStream code and required toolboxes

Changed:
<
<
The BrainStream package can be downloaded here. (Please note that the current download is an older version of BrainStream. A new release will be available end of January 2012.) After downloading, the code must be available either through a local copy of a repository or through a connected server.
>
>
The BrainStream package can be downloaded here (will be available end of January 2015.) or via alternative checkout from another repository (internal people only).
 
Changed:
<
<
BrainStream requires some additional software, which is standardly included with the distribution of BrainStream. This is an overview of the additional software:
FieldTrip toolbox
Java library for reading/writing Excel, jxl.jar GNU Library or Lesser General Public License (LGPL)
MSocket: Copyright (c)* 2006 MIT Lincoln Laboratory, Steven Michael (smichael@ll.mit.edu)
fparser.m: Copyright (c)* 2009, urs (us) schwarz (us@neurol.unizh.ch)
uipickfiles.m: Copyright (c)* 2007, Douglas M. Schwarz
inifile.m: Copyright (c)* 2003-2005 Primoz Cermelj, Slovenia (primoz.cermelj@email.si)

(c)* All rights reserved, BSD license (see Matlab for explanation or read the BSD.txt file in third_parties subfolder in BrainStream's core folder)

>
>
BrainStream requires some additional software, which is standardly included with the distribution of BrainStream. This is an overview of the additional software:
FieldTrip toolbox
Java library for reading/writing Excel, jxl.jar GNU Library or Lesser General Public License (LGPL)
MSocket: Copyright (c)* 2006 MIT Lincoln Laboratory, Steven Michael (smichael@ll.mit.edu)
fparser.m: Copyright (c)* 2009, urs (us) schwarz (us@neurol.unizh.ch)
uipickfiles.m: Copyright (c)* 2007, Douglas M. Schwarz
inifile.m: Copyright (c)* 2003-2005 Primoz Cermelj, Slovenia (primoz.cermelj@email.si)
findjobj.m: Copyright (c)* 2014, Yair Altman
GUILayout: Copyright * 2014, Ben Tordoff
jsonlab: Copyright(c)* 2011-2014 Qianqian Fang
(c)* All rights reserved, BSD license (see Matlab for explanation or read the BSD.txt file in third_parties subfolder in BrainStream's core folder)
 

Add BrainStream's core folder to the Matlab path

Line: 44 to 42
  When the buffer is connected to the acquisition system, it looks like this:
Changed:
<
<
buffer.png
>
>
buffer.png
 

Online Data Manager (ODM)

Revision 1116 May 2012 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Line: 127 to 127
  ret = 0; end
Changed:
<
<
Note: If your function for sending out markers requires specific resources, they should also be installed at every connected client. In your experiment design insert a marker from the BS_INIT processing pipeline and define it to execute on the client, which actions then should install required resources.
>
>
Note: If your function for sending out markers requires specific resources (both software and hardware), they should also be installed at every connected client. In your experiment design insert a marker from the BS_INIT processing pipeline and define it to execute on the client, which actions then should install required software resources.
 

Firewall settings

BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further to connect to buffers streaming data (either acquired, simulated, or from file), or to install buffers related to BrainStream's pre-processing option. Make sure these ports are not blocked by your firewall.

Revision 1015 May 2012 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Line: 107 to 107
  An example using a PC's COMM port looks like this:
function [event, ret] = sndCOMMarker(event,m)
Changed:
<
<
mlock persistent serobjw
>
>
mlock % prevent unwanted clearing of persistent variable serobjw
 if isempty(serobjw) serobjw = serial('COM1'); % Creating serial port object serobjw.Baudrate = 115200; % Set the baud rate at the specific value
Line: 124 to 123
  fclose(serobjw); % close it ret = 1; catch err
Deleted:
<
<
event = bs_warn(event,err.message);
  disp(err.message); ret = 0;
Changed:
<
<
end
>
>
end

Note: If your function for sending out markers requires specific resources, they should also be installed at every connected client. In your experiment design insert a marker from the BS_INIT processing pipeline and define it to execute on the client, which actions then should install required resources.

 

Firewall settings

BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further to connect to buffers streaming data (either acquired, simulated, or from file), or to install buffers related to BrainStream's pre-processing option. Make sure these ports are not blocked by your firewall.

Revision 909 Feb 2012 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Line: 32 to 32
  In BrainStream, the interfacing software is located in the FieldTrip folder: fieldtrip/realtime/acquisition/<system> (you can find the FieldTrip folder by typing bs_folder('FIELDTRIP') in the Matlab command window). Copy this folder to the location where you want to execute biosemi2ft (note that the recorded data will be saved in this location as well).
Changed:
<
<
The BioSemi system needs a configuration (.cfg) file in which some acquisition-related settings are specified. Configuration files for the BioSemi system specify for example from how many channels data should be recorded, and whether the data should be downsampled. Several configuration files for the BioSemi system are available in BrainStream's resources folder (type bs_folder('RESOURCES') in the Matlab command window to find this folder). For more information about configuration files for different acquisition systems, see the FieldTrip website.
>
>
The BioSemi system needs a configuration (.cfg) file in which some acquisition-related settings are specified. Configuration files for the BioSemi system specify for example from how many channels data should be recorded, and whether the data should be downsampled. Several configuration files for the BioSemi system are available in BrainStream's resources folder (type bs_folder('RESOURCES') in the Matlab command window to find this folder). For more information about configuration files for different acquisition systems, see the Fieldtrip website.
  To start the buffer that connects to the acquisition system, open the terminal (Mac) or command prompt (PC) and go to the folder where you copied biosemi2ft. Then execute:
biosemi2ft <config_file> <gdf-file> <hostname> <port>

Revision 803 Jan 2012 - Main.MarjoleinVanDerWaal

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Line: 6 to 6
 

Start-up checklist

Ensure availability of a Matlab license

Changed:
<
<
BrainStream requires Matlab version 2008a or higher. The availability of this license depends on your institution's licensing agreements with MathWorks. BrainStream also requires a license for, and availability of Matlab's Signal Processing Toolbox.
>
>
BrainStream requires Matlab version 2008a or higher. The availability of this license depends on your institution's licensing agreements with MathWorks. BrainStream also requires Matlab's Signal Processing Toolbox.
 

Ensure access to BrainStream code and required toolboxes

The BrainStream package can be downloaded here. (Please note that the current download is an older version of BrainStream. A new release will be available end of January 2012.) After downloading, the code must be available either through a local copy of a repository or through a connected server.

Line: 131 to 131
 

Firewall settings

Changed:
<
<
BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further to connect to buffers streaming data (either acquired, simulated or from file), or to install buffers related to BrainStreams pre-processing option. Make sure these ports are not blocked by your firewall.
>
>
BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further to connect to buffers streaming data (either acquired, simulated, or from file), or to install buffers related to BrainStream's pre-processing option. Make sure these ports are not blocked by your firewall.
 
META FILEATTACHMENT attachment="buffer.png" attr="" comment="" date="1324026657" name="buffer.png" path="buffer.png" size="134408" stream="buffer.png" tmpFilename="/var/tmp/CGItemp55954" user="MarjoleinVanDerWaal" version="1"

Revision 718 Dec 2011 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Line: 84 to 84
  There are different approaches for inserting hardware markers, depending on the specific hardware device you are using. Markers may for example be inserted via a PC's parallel or serial port or via an input port that is specific to the hardware device. For example, the BioSemi Active Two amplifier has an input trigger channel through which markers can be inserted.
Changed:
<
<
Users should always use BrainStream's bs_send_hardware_marker function to send hardware markers. This function will look in the blocksettings for a sndMarker function which actually sends the markers to the hardware device. You must specify this function under topic [<device>] and key SendMarkerFnc. The default sndMarker function is sndBufferMarker, which sends the marker via the FieldTrip buffer (i.e. not via the hardware).
>
>
Users should always use BrainStream's bs_send_hardware_marker function to send hardware markers to keep code independent of connected hardware. This function will look in the blocksettings for a sndMarker function which actually sends the markers to the hardware device. You must specify this function under topic [<device>] and key SendMarkerFnc. The default sndMarker function is sndBufferMarker, which sends the marker via the FieldTrip buffer (i.e. not via the hardware).
 
[biosemi_active2]
SendMarkerFnc = 'sndBufferMarker' %default 

Revision 616 Dec 2011 - Main.MarjoleinVanDerWaal

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Line: 9 to 9
  BrainStream requires Matlab version 2008a or higher. The availability of this license depends on your institution's licensing agreements with MathWorks. BrainStream also requires a license for, and availability of Matlab's Signal Processing Toolbox.

Ensure access to BrainStream code and required toolboxes

Changed:
<
<
The BrainStream package can be downloaded here. After downloading, the code must be available either through a local copy of a repository or through a connected server.
>
>
The BrainStream package can be downloaded here. (Please note that the current download is an older version of BrainStream. A new release will be available end of January 2012.) After downloading, the code must be available either through a local copy of a repository or through a connected server.
  BrainStream requires some additional software, which is standardly included with the distribution of BrainStream. This is an overview of the additional software:
FieldTrip toolbox
Java library for reading/writing Excel, jxl.jar GNU Library or Lesser General Public License (LGPL)
MSocket: Copyright (c)* 2006 MIT Lincoln Laboratory, Steven Michael (smichael@ll.mit.edu)
fparser.m: Copyright (c)* 2009, urs (us) schwarz (us@neurol.unizh.ch)
uipickfiles.m: Copyright (c)* 2007, Douglas M. Schwarz
inifile.m: Copyright (c)* 2003-2005 Primoz Cermelj, Slovenia (primoz.cermelj@email.si)

Revision 516 Dec 2011 - Main.MarjoleinVanDerWaal

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Line: 21 to 21
 The BrainStream core folder must be on your Matlab path. You can either add this folder to the Matlab path as described here or make sure that the BrainStream core folder is your current working directory.

During runtime, BrainStream itself will add all folders required for BrainStream processing to the path. If you need any additional folders on your Matlab path, you can add them to the path in several ways (see the Paths and Folders section for more information).

Check if your hardware is supported

Changed:
<
<
BrainStream connects to hardware devices via a FieldTrip buffer. This connection is controlled by interfacing software. Each acquisition system has its own interfacing software, which is called <system>2ft. For example, the software for the BioSemi acquisition system is called biosemi2ft. See the FieldTrip website for a list of hardware systems for which interfacing software is available. If your hardware is supported, you can proceed to set up the connection between BrainStream and your hardware.
>
>
BrainStream connects to hardware devices via a FieldTrip buffer. This connection is controlled by interfacing software. Each acquisition system has its own interfacing software, which is called <system>2ft. For example, the software for the BioSemi acquisition system is called biosemi2ft. See the FieldTrip website for a list of hardware systems for which interfacing software is available. If your hardware is supported, you can proceed to set up the connection between BrainStream and your hardware.
 

Hardware Setup

Interfacing software

Changed:
<
<
Any acquisition system supported by the FieldTrip toolbox can be used as a data source within BrainStream. The connection between hardware systems and the FieldTrip buffer is handled by interfacing software. Here, we will show how to use the interfacing software for the BioSemi acquisition system (biosemi2ft). For more information about the interfacing software for other acquisition systems, see the FieldTrip website.
>
>
Any acquisition system supported by the FieldTrip toolbox can be used as a data source within BrainStream. BrainStream does not connect to the hardware directly, but via a FieldTrip buffer. The connection between hardware systems and the FieldTrip buffer is handled by interfacing software. Here, we will show how to use the interfacing software for the BioSemi acquisition system (biosemi2ft). For more information about the interfacing software for other acquisition systems, see the FieldTrip website.
  In BrainStream, the interfacing software is located in the FieldTrip folder: fieldtrip/realtime/acquisition/<system> (you can find the FieldTrip folder by typing bs_folder('FIELDTRIP') in the Matlab command window). Copy this folder to the location where you want to execute biosemi2ft (note that the recorded data will be saved in this location as well).
Line: 40 to 40
 : configuration file <gdf-file>: base name of the gdf file. The suffix .gdf and session counters will be added automatically. : optional, default is 'localhost'
Changed:
<
<
: optional, default is 1972[image]
>
>
: optional, default is 1972

When the buffer is connected to the acquisition system, it looks like this:

buffer.png

 

Online Data Manager (ODM)

Line: 55 to 59
 If the interfacing software <system>2ft does not support the Online Data Manager, the OnlineDataManager key must always be set to 0 (default).

Start and Stop Functions

Changed:
<
<
BrainStream offers the option to specify functions that execute either before starting or after stopping streaming data from the hardware device. For example, these functions may start the interfacing software automatically or take care of copying the acquired gdf-file to some dedicated location. You can define the Start and Stop functions in the block file under topic [<device>] and keys startFunction and stopFunction:
>
>
BrainStream offers the option to specify functions that will be executed either before starting or after stopping streaming data from the hardware device. For example, these functions may start the interfacing software automatically or take care of copying the acquired gdf-file to some dedicated location. You can define the Start and Stop functions in the block file under topic [<device>] and keys startFunction and stopFunction:
 
[biosemi_active2] 
startFunction = 'cleanup'
stopFunction = 'copy_rawdata' 
Line: 76 to 80
 

Hardware markers

Changed:
<
<
Markers can be added to the data either via the hardware or via the FieldTrip buffer (see Inserting Markers for more information). A major reason to use hardware instead of buffer markers is the fact that a better synchronization between presented stimuli and data can be achieved.
>
>
Markers can be added to the data either via the hardware or via the FieldTrip buffer (see Inserting Markers for more information). A major reason to use hardware instead of buffer markers is the fact that a better synchronization between presented stimuli and data can be achieved. If your hardware device does not support solutions to insert markers via the hardware, you can send all markers via the FieldTrip buffer directly, but note that these markers will be less accurately synchronized with the data.
  There are different approaches for inserting hardware markers, depending on the specific hardware device you are using. Markers may for example be inserted via a PC's parallel or serial port or via an input port that is specific to the hardware device. For example, the BioSemi Active Two amplifier has an input trigger channel through which markers can be inserted.
Changed:
<
<
Users should always use BrainStream's bs_send_hardware_marker function to send hardware markers. This function will look in the blocksettings for a sndMarker function. You must specify this function under topic x and key %ENDCOLOR%SendMarkerFnc. The default sndMarker function is sndBufferMarker, which sends the marker via the FieldTrip buffer (i.e. not via the hardware).
SendMarkerFnc = 'sndBufferMarker' %default 
>
>
Users should always use BrainStream's bs_send_hardware_marker function to send hardware markers. This function will look in the blocksettings for a sndMarker function which actually sends the markers to the hardware device. You must specify this function under topic [<device>] and key SendMarkerFnc. The default sndMarker function is sndBufferMarker, which sends the marker via the FieldTrip buffer (i.e. not via the hardware).
[biosemi_active2]
SendMarkerFnc = 'sndBufferMarker' %default 
 
Changed:
<
<
You can write your own sndMarker function for actually sending the markers to the hardware device. A custom sndMyMarker function should be in the following format:
>
>
You can write your own sndMarker function for sending markers to your specific hardware device. A custom sndMyMarker function should be in the following format:
 
function [event, ret] = sndMyMarker(event,m)
% m.name     = name of marker
% m.type     = type marker
Line: 100 to 106
 end

An example using a PC's COMM port looks like this:

Changed:
<
<
function [event, ret] = sndCOMMarker(event,m) mlock persistent serobjw if isempty(serobjw)    serobjw = serial('COM1');              % Creating serial port object    serobjw.Baudrate = 115200;             % Set the baud rate at the specific value    set(serobjw, 'Parity', 'none');        % Set parity as none    set(serobjw, 'Databits', 8);           % set the number of data bits    set(serobjw, 'StopBits', 1);           % set number of stop bits as 1    set(serobjw, 'Terminator', '');        % set the terminator value to newline    set(serobjw, 'OutputBufferSize', 512); % Buffer for write end try    fopen(serobjw);    fwrite(serobjw,str2double(m.value)); % write to serial port    fclose(serobjw); % close it    ret = 1; catch err     event = bs_warn(event,err.message);    disp(err.message);    ret = 0; end
Not all devices support solutions to insert markers via the hardware. If this is the case, you can send all markers via the FieldTrip buffer directly, but note that these markers will be less accurately synchronized with the data.
>
>
function [event, ret] = sndCOMMarker(event,m)
mlock
persistent serobjw
if isempty(serobjw)
   serobjw = serial('COM1');              % Creating serial port object
   serobjw.Baudrate = 115200;             % Set the baud rate at the specific value
   set(serobjw, 'Parity', 'none');        % Set parity as none
   set(serobjw, 'Databits', 8);           % set the number of data bits
   set(serobjw, 'StopBits', 1);           % set number of stop bits as 1
   set(serobjw, 'Terminator', '');        % set the terminator value to newline
   set(serobjw, 'OutputBufferSize', 512); % Buffer for write
end
try
   fopen(serobjw);
   fwrite(serobjw,str2double(m.value)); % write to serial port
   fclose(serobjw); % close it
   ret = 1;
catch err 
   event = bs_warn(event,err.message);
   disp(err.message);
   ret = 0;
end
 

Firewall settings

BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further to connect to buffers streaming data (either acquired, simulated or from file), or to install buffers related to BrainStreams pre-processing option. Make sure these ports are not blocked by your firewall.
Added:
>
>
META FILEATTACHMENT attachment="buffer.png" attr="" comment="" date="1324026657" name="buffer.png" path="buffer.png" size="134408" stream="buffer.png" tmpFilename="/var/tmp/CGItemp55954" user="MarjoleinVanDerWaal" version="1"

Revision 415 Dec 2011 - Main.MarjoleinVanDerWaal

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Line: 26 to 26
 

Hardware Setup

Added:
>
>

Interfacing software

  Any acquisition system supported by the FieldTrip toolbox can be used as a data source within BrainStream. The connection between hardware systems and the FieldTrip buffer is handled by interfacing software. Here, we will show how to use the interfacing software for the BioSemi acquisition system (biosemi2ft). For more information about the interfacing software for other acquisition systems, see the FieldTrip website.
Line: 77 to 78
  Markers can be added to the data either via the hardware or via the FieldTrip buffer (see Inserting Markers for more information). A major reason to use hardware instead of buffer markers is the fact that a better synchronization between presented stimuli and data can be achieved.
Changed:
<
<
Users should always use BrainStream's bs_send_hardware_marker function to send hardware markers, it will read from the blocksettings which function to use for the hardware device the marker should be sent to.
>
>
There are different approaches for inserting hardware markers, depending on the specific hardware device you are using. Markers may for example be inserted via a PC's parallel or serial port or via an input port that is specific to the hardware device. For example, the BioSemi Active Two amplifier has an input trigger channel through which markers can be inserted.
 
Changed:
<
<
A custom sndMyMarker function responsible for actually sending markers to some specific hardware should obey following format:
>
>
Users should always use BrainStream's bs_send_hardware_marker function to send hardware markers. This function will look in the blocksettings for a sndMarker function. You must specify this function under topic x and key %ENDCOLOR%SendMarkerFnc. The default sndMarker function is sndBufferMarker, which sends the marker via the FieldTrip buffer (i.e. not via the hardware).
SendMarkerFnc = 'sndBufferMarker' %default 

You can write your own sndMarker function for actually sending the markers to the hardware device. A custom sndMyMarker function should be in the following format:

 
function [event, ret] = sndMyMarker(event,m)
% m.name     = name of marker
% m.type     = type marker
Line: 93 to 97
  ret = 1; catch err ret = 0;
Changed:
<
<
endAn example using a PC's COMM port looks like this:
function [event, ret] = sndCOMMarker(event,m)
mlock
persistent serobjw
if isempty(serobjw)
   serobjw = serial('COM1');              % Creating serial port object
   serobjw.Baudrate = 115200;             % Set the baud rate at the specific value
   set(serobjw, 'Parity', 'none');        % Set parity as none
   set(serobjw, 'Databits', 8);           % set the number of data bits
   set(serobjw, 'StopBits', 1);           % set number of stop bits as 1
   set(serobjw, 'Terminator', '');        % set the terminator value to newline
   set(serobjw, 'OutputBufferSize', 512); % Buffer for write
end
try
   fopen(serobjw);
   fwrite(serobjw,str2double(m.value)); % write to serial port
   fclose(serobjw); % close it
   ret = 1;
catch err 
   event = bs_warn(event,err.message);
   disp(err.message);
   ret = 0;
end


 
Not all devices support solutions to insert markers by hardware, in that case you should send markers to the fieldtrip buffer directly.
>
>
end
 
Changed:
<
<

9.5. Firewall settings

BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further (dependent of the number of required file proxies) to connect to buffers that stream acquired data, simulated data or from file replayed data, or to install buffers related to BrainStreams pre-processing option. Make sure these ports are not blocked by your firewall.
>
>
An example using a PC's COMM port looks like this:
function [event, ret] = sndCOMMarker(event,m) mlock persistent serobjw if isempty(serobjw)    serobjw = serial('COM1');              % Creating serial port object    serobjw.Baudrate = 115200;             % Set the baud rate at the specific value    set(serobjw, 'Parity', 'none');        % Set parity as none    set(serobjw, 'Databits', 8);           % set the number of data bits    set(serobjw, 'StopBits', 1);           % set number of stop bits as 1    set(serobjw, 'Terminator', '');        % set the terminator value to newline    set(serobjw, 'OutputBufferSize', 512); % Buffer for write end try    fopen(serobjw);    fwrite(serobjw,str2double(m.value)); % write to serial port    fclose(serobjw); % close it    ret = 1; catch err     event = bs_warn(event,err.message);    disp(err.message);    ret = 0; end
Not all devices support solutions to insert markers via the hardware. If this is the case, you can send all markers via the FieldTrip buffer directly, but note that these markers will be less accurately synchronized with the data.
 
Changed:
<
<

9.6. Test BrainStream

>
>

Firewall settings

BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further to connect to buffers streaming data (either acquired, simulated or from file), or to install buffers related to BrainStreams pre-processing option. Make sure these ports are not blocked by your firewall.

Revision 315 Dec 2011 - Main.MarjoleinVanDerWaal

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installation Guide

Start-up checklist

Deleted:
<
<
  • Ensure availability of a Matlab license (requires version 2008a or higher)
  • Ensure access to BrainStream code and required toolboxes (BrainStream standard includes the fieldtrip toolbox)
  • Add the BrainStream core folder to the Matlab path
  • Check if your hardware is supported (see Environments)
  • Define your BrainStream project
  • Compose experiment definition tables
  • Compose user defined functions
 

Ensure availability of a Matlab license

BrainStream requires Matlab version 2008a or higher. The availability of this license depends on your institution's licensing agreements with MathWorks. BrainStream also requires a license for, and availability of Matlab's Signal Processing Toolbox.

Ensure access to BrainStream code and required toolboxes

Line: 28 to 21
 The BrainStream core folder must be on your Matlab path. You can either add this folder to the Matlab path as described here or make sure that the BrainStream core folder is your current working directory.

During runtime, BrainStream itself will add all folders required for BrainStream processing to the path. If you need any additional folders on your Matlab path, you can add them to the path in several ways (see the Paths and Folders section for more information).

Check if your hardware is supported

Changed:
<
<
BrainStream supports a number of hardware devices. If your hardware is not yet supported by BrainStream, you can make the hardware accessible to BrainStream yourself (see the next section).
>
>
BrainStream connects to hardware devices via a FieldTrip buffer. This connection is controlled by interfacing software. Each acquisition system has its own interfacing software, which is called <system>2ft. For example, the software for the BioSemi acquisition system is called biosemi2ft. See the FieldTrip website for a list of hardware systems for which interfacing software is available. If your hardware is supported, you can proceed to set up the connection between BrainStream and your hardware.
 
Changed:
<
<

9.2. Setup accessing the hardware

>
>

Hardware Setup

 
Changed:
<
<
This is only required if your hardware is not yet supported by BrainStream.
>
>
Any acquisition system supported by the FieldTrip toolbox can be used as a data source within BrainStream. The connection between hardware systems and the FieldTrip buffer is handled by interfacing software. Here, we will show how to use the interfacing software for the BioSemi acquisition system (biosemi2ft). For more information about the interfacing software for other acquisition systems, see the FieldTrip website.
 
Changed:
<
<
The connection between specific hardware devices and the FieldTrip buffer is controlled by interfacing software. Each acquisition system has its own interfacing software, which is called <system>2ft. For example, the software for the BioSemi acquisition system is called biosemi2ft. See the FieldTrip website for a list of hardware systems for which interfacing software is available. Here, we will show how to use the interfacing software for the BioSemi system. For more information about the interfacing software for other acquisition system, see the FieldTrip website.
>
>
In BrainStream, the interfacing software is located in the FieldTrip folder: fieldtrip/realtime/acquisition/<system> (you can find the FieldTrip folder by typing bs_folder('FIELDTRIP') in the Matlab command window). Copy this folder to the location where you want to execute biosemi2ft (note that the recorded data will be saved in this location as well).
 
Changed:
<
<
In BrainStream, the interfacing software is located in the FieldTrip folder: fieldtrip/realtime/acquisition/<system> (you can locate the FieldTrip folder by typing bs_folder('FIELDTRIP') in the Matlab command window). Copy this folder to the location where you want to execute biosemi2ft. Start the terminal (Mac) or command prompt (PC) and make sure to be in the folder where you copied biosemi2ft, then execute:
biosemi2ft <config_file> <gdf-file> <hostname> <port>
>
>
The BioSemi system needs a configuration (.cfg) file in which some acquisition-related settings are specified. Configuration files for the BioSemi system specify for example from how many channels data should be recorded, and whether the data should be downsampled. Several configuration files for the BioSemi system are available in BrainStream's resources folder (type bs_folder('RESOURCES') in the Matlab command window to find this folder). For more information about configuration files for different acquisition systems, see the FieldTrip website.
 
Changed:
<
<
The biosemi2ft software supports fieldtrips Online Data Manager, which allows for a remotely configuration of streamed/saved channels and filter settings. BrainStream supports this feature and in order to use it, define the configureFile key for corresponding hardware devices topic in the blocksettings. Also enable this feature by setting the OnlineDataManager key to 1, and make sure the remotePort key is set to the same port value specified at startup of biosemi2ft. BrainStream will then send these configuration settings to the interface software along with a name for the gdf-file saving the raw data. Note that this name doesn't include path information and therefore data is stored in the folder where biosemi2ft resides.
>
>
To start the buffer that connects to the acquisition system, open the terminal (Mac) or command prompt (PC) and go to the folder where you copied biosemi2ft. Then execute:
biosemi2ft <config_file> <gdf-file> <hostname> <port>

<config_file>: configuration file
<gdf-file>: base name of the gdf file. The suffix .gdf and session counters will be added automatically.
<hostname>: optional, default is 'localhost'
<port>: optional, default is 1972
[image]

Online Data Manager (ODM)

The biosemi2ft software supports FieldTrip's Online Data Manager, which enables a remote configuration of acquisition settings. For example, you can change the number of streamed or saved channels and filter settings while the biosemi2ft software is running.

In BrainStream, the Online Data Manager allows you to specify acquisition-related settings in your block file. Under topic [<device>], set the OnlineDataManager key to 1 and the remotePort key to the same port value specified at startup of biosemi2ft. You can now specify additional settings as keys under the same topic. For example, under key configureFile, you can specify a configuration file that is different than the one that was used for biosemi2ft startup. BrainStream will send these new configuration settings to the interface software along with a name for the gdf-file saving the raw data.

 
[biosemi_active2] 
Changed:
<
<
configureFile = 'biosemi_active2_cap64.cfg' OnlineDataManager = 1
>
>
OnlineDataManager? = 1
 remotePort = 8000
Changed:
<
<
startFunction = 'cleanup' stopFunction = 'copy_rawdata'
>
>
configureFile = 'biosemi_active2_cap64.cfg'
 
Changed:
<
<
If the interfacing software xxx2ft does not support the Online Data Manager, make sure to set the OnlineDataManager key to 0 (default).
>
>
If the interfacing software <system>2ft does not support the Online Data Manager, the OnlineDataManager key must always be set to 0 (default).

Start and Stop Functions

 
Changed:
<
<
BrainStreams offers the option to specify functions that execute either before starting or after stopping streaming data from the hardware device. Use the startFunction and stopFunction key for corresponding hardware devices topic. This is for example useful to have those functions start the interfacing software automatically or take care of copying the acquired gdf-file to some dedicated location. Those functions should take the form:
>
>
BrainStream offers the option to specify functions that execute either before starting or after stopping streaming data from the hardware device. For example, these functions may start the interfacing software automatically or take care of copying the acquired gdf-file to some dedicated location. You can define the Start and Stop functions in the block file under topic [<device>] and keys startFunction and stopFunction:
[biosemi_active2] 
startFunction = 'cleanup'
stopFunction = 'copy_rawdata' 

The functions should take the form:

 
function my_custom_startFunction(datasource,device) 
Changed:
<
<
% datasource: your reference name of the data source (in the example above: eeg) % device: name referring to the hardware device (in the example above: biosemi_active2)
>
>
% datasource: reference name of the data source (for example: 'eeg') % device: reference name of the hardware device (for example: 'biosemi_active2')
 % add code to handle specific tasks, required in your lab before connecting to the fieldtrip buffer

function my_custom_stopFunction(datasource,device)

Changed:
<
<
% datasource: your reference name of the data source (in the example above: eeg) % device: name referring to the hardware device (in the example above: biosemi_active2)
>
>
% datasource: reference name of the data source (for example: 'eeg') % device: reference name of the hardware device (for example: 'biosemi_active2')
 % add code to handle specific tasks, required in your lab after completing a block

Changed:
<
<

9.4. Hardware markers

>
>

Hardware markers

 
Changed:
<
<
Click here to read how BrainStream processes incoming markers.
Click here to read what options users have to insert markers. (to do: write it)
>
>
Markers can be added to the data either via the hardware or via the FieldTrip buffer (see Inserting Markers for more information). A major reason to use hardware instead of buffer markers is the fact that a better synchronization between presented stimuli and data can be achieved.
 
Changed:
<
<
A major reason to use hardware instead of software markers is the fact that a better synchronization between presented stimuli and data can be achieved. Not all devices support solutions to insert markers by hardware, in that case you should send markers to the fieldtrip buffer directly. It depends on the specific implementaton of the xxx2ft interface software how accurate the synchronization with data will be. More specific, it depends on the size of the chunks of data constantly being updated to the buffer. For example, biosemi2ft standardly updates the buffer with chunks of data sized approximately 15 samples. In that case, a marker directly sent to the buffer would synchronize data with approximately 7.3 ms accuracy (sample rate 2048 Hz), instead of 0.5 ms when sent to the hardware (1 sample). For online experiments that in general use much lower sample rates, the difference between the two reduces considerably. These differences are especially relevant to experiment designs susceptible to accurate timing.
Users should always use BrainStreams sndMarker function to send hardware markers, it will read from the blocksettings which function to use for the hardware device the marker should be sent to.
>
>
Users should always use BrainStream's bs_send_hardware_marker function to send hardware markers, it will read from the blocksettings which function to use for the hardware device the marker should be sent to.
  A custom sndMyMarker function responsible for actually sending markers to some specific hardware should obey following format:
function [event, ret] = sndMyMarker(event,m)
Line: 108 to 117
 end
Changed:
<
<
>
>
Not all devices support solutions to insert markers by hardware, in that case you should send markers to the fieldtrip buffer directly.
 

9.5. Firewall settings

BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further (dependent of the number of required file proxies) to connect to buffers that stream acquired data, simulated data or from file replayed data, or to install buffers related to BrainStreams pre-processing option. Make sure these ports are not blocked by your firewall.

Revision 214 Dec 2011 - Main.MarjoleinVanDerWaal

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Changed:
<
<

Installation Guide

>
>

Installation Guide

 
Changed:
<
<

9.1. Start-up checklist

  • Ensure availability of a Matlab licence (requires version 2008a or higher)
>
>

Start-up checklist

  • Ensure availability of a Matlab license (requires version 2008a or higher)
 
  • Ensure access to BrainStream code and required toolboxes (BrainStream standard includes the fieldtrip toolbox)
  • Add the BrainStream core folder to the Matlab path
  • Check if your hardware is supported (see Environments)
  • Define your BrainStream project
  • Compose experiment definition tables
  • Compose user defined functions
Changed:
<
<

9.1.1. Ensure availability of a MatLab licence

This availability depends on your institution's licensing agreements with MathWorks. BrainStream also requires a license for, and availability of Matlab Signal Processing Toolbox.

9.1.2. Ensure access to BrainStream code and required toolboxes

>
>

Ensure availability of a Matlab license

BrainStream requires Matlab version 2008a or higher. The availability of this license depends on your institution's licensing agreements with MathWorks. BrainStream also requires a license for, and availability of Matlab's Signal Processing Toolbox.

Ensure access to BrainStream code and required toolboxes

 
Changed:
<
<
Assure availability of the BrainStream code, either through a local copy of a repository or through a connected server. It can be downloaded from: http://code.google.com/p/brainstream/downloads/list
BrainStream requires the following toolbox (standard included with the distribution of BrainStream):
* Fieldtrip toolbox: http://fieldtrip.fcdonders.nl/download
>
>
The BrainStream package can be downloaded here. After downloading, the code must be available either through a local copy of a repository or through a connected server.
 
Changed:
<
<
Other software used by BrainStream (all available after BrainStream download):
* Java library for reading/writing Excel, jxl.jar GNU Library or Lesser General Public License (LGPL) http://www.andykhan.com/jexcelapi/
* MSocket: Copyright (c)* 2006 MIT Lincoln Laboratory, Steven Michael (smichael@ll.mit.edu), http://www.mathworks.com/matlabcentral/fileexchange/11130
* fparser.m: Copyright (c)* 2009, urs (us) schwarz, us@neurol.unizh.ch, http://www.mathworks.com/matlabcentral/fileexchange/3915
* uipickfiles.m: Copyright (c)* 2007, Douglas M. Schwarz, http://www.mathworks.com/matlabcentral/fileexchange/10867
* inifile.m: Copyright (c)* 2003-2005 Primoz Cermelj, Slovenia (primoz.cermelj@email.si), http://www.mathworks.com/matlabcentral/fileexchange/2976
>
>
BrainStream requires some additional software, which is standardly included with the distribution of BrainStream. This is an overview of the additional software:
FieldTrip toolbox
Java library for reading/writing Excel, jxl.jar GNU Library or Lesser General Public License (LGPL)
MSocket: Copyright (c)* 2006 MIT Lincoln Laboratory, Steven Michael (smichael@ll.mit.edu)
fparser.m: Copyright (c)* 2009, urs (us) schwarz (us@neurol.unizh.ch)
uipickfiles.m: Copyright (c)* 2007, Douglas M. Schwarz
inifile.m: Copyright (c)* 2003-2005 Primoz Cermelj, Slovenia (primoz.cermelj@email.si)
 
Changed:
<
<
(c)* All rights reserved, BSD license (see Matlab for explanation or read BSD.txt file in third_parties subfolder in BrainStream's core folder)
>
>
(c)* All rights reserved, BSD license (see Matlab for explanation or read the BSD.txt file in third_parties subfolder in BrainStream's core folder)
 
Added:
>
>

Add BrainStream's core folder to the Matlab path

 
Changed:
<
<

9.1.3. Check if your hardware is supported

>
>
The BrainStream core folder must be on your Matlab path. You can either add this folder to the Matlab path as described here or make sure that the BrainStream core folder is your current working directory.

During runtime, BrainStream itself will add all folders required for BrainStream processing to the path. If you need any additional folders on your Matlab path, you can add them to the path in several ways (see the Paths and Folders section for more information).

Check if your hardware is supported

 
Changed:
<
<
These settings concern the hardware environment you are working in. This is only required if your hardware is not yet supported by BrainStream (see GettingStarted).
>
>
BrainStream supports a number of hardware devices. If your hardware is not yet supported by BrainStream, you can make the hardware accessible to BrainStream yourself (see the next section).
 
Line: 59 to 62
 % device: name referring to the hardware device (in the example above: biosemi_active2) % add code to handle specific tasks, required in your lab after completing a block
Deleted:
<
<

9.3. Add the BrainStream core folder to the Matlab path

Matlab path must include BrainStream s core folder, any further required BrainStream folders will be added by BrainStream.

Either save BrainStreams core folder to Matlabs path permanently by choosing Set Path in the file menu, or make sure your working directory is at the BrainStream core folder.

During runtime, any other folders that need to be added to the Matlab path can be handled by block file settings for the Experiment topic. The keys MatlabPathAdd and MatlabPathFnc take care of this. Specify a string cell array with folders to add (they always add recursively), or specify a function that adds folders to the Matlab path. When specific plugins require access to Java classes from within BrainStream, this function should then also add these to the Matlab's JavaClassPath.
 

9.4. Hardware markers

Revision 117 Nov 2011 - Main.MarjoleinVanDerWaal

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WebHome"

Installation Guide

9.1. Start-up checklist

  • Ensure availability of a Matlab licence (requires version 2008a or higher)
  • Ensure access to BrainStream code and required toolboxes (BrainStream standard includes the fieldtrip toolbox)
  • Add the BrainStream core folder to the Matlab path
  • Check if your hardware is supported (see Environments)
  • Define your BrainStream project
  • Compose experiment definition tables
  • Compose user defined functions

9.1.1. Ensure availability of a MatLab licence

This availability depends on your institution's licensing agreements with MathWorks. BrainStream also requires a license for, and availability of Matlab Signal Processing Toolbox.

9.1.2. Ensure access to BrainStream code and required toolboxes

Assure availability of the BrainStream code, either through a local copy of a repository or through a connected server. It can be downloaded from: http://code.google.com/p/brainstream/downloads/list
BrainStream requires the following toolbox (standard included with the distribution of BrainStream):
* Fieldtrip toolbox: http://fieldtrip.fcdonders.nl/download

Other software used by BrainStream (all available after BrainStream download):
* Java library for reading/writing Excel, jxl.jar GNU Library or Lesser General Public License (LGPL) http://www.andykhan.com/jexcelapi/
* MSocket: Copyright (c)* 2006 MIT Lincoln Laboratory, Steven Michael (smichael@ll.mit.edu), http://www.mathworks.com/matlabcentral/fileexchange/11130
* fparser.m: Copyright (c)* 2009, urs (us) schwarz, us@neurol.unizh.ch, http://www.mathworks.com/matlabcentral/fileexchange/3915
* uipickfiles.m: Copyright (c)* 2007, Douglas M. Schwarz, http://www.mathworks.com/matlabcentral/fileexchange/10867
* inifile.m: Copyright (c)* 2003-2005 Primoz Cermelj, Slovenia (primoz.cermelj@email.si), http://www.mathworks.com/matlabcentral/fileexchange/2976

(c)* All rights reserved, BSD license (see Matlab for explanation or read BSD.txt file in third_parties subfolder in BrainStream's core folder)

9.1.3. Check if your hardware is supported

These settings concern the hardware environment you are working in. This is only required if your hardware is not yet supported by BrainStream (see GettingStarted).

9.2. Setup accessing the hardware

This is only required if your hardware is not yet supported by BrainStream.

The connection between specific hardware devices and the FieldTrip buffer is controlled by interfacing software. Each acquisition system has its own interfacing software, which is called <system>2ft. For example, the software for the BioSemi acquisition system is called biosemi2ft. See the FieldTrip website for a list of hardware systems for which interfacing software is available. Here, we will show how to use the interfacing software for the BioSemi system. For more information about the interfacing software for other acquisition system, see the FieldTrip website.

In BrainStream, the interfacing software is located in the FieldTrip folder: fieldtrip/realtime/acquisition/<system> (you can locate the FieldTrip folder by typing bs_folder('FIELDTRIP') in the Matlab command window). Copy this folder to the location where you want to execute biosemi2ft. Start the terminal (Mac) or command prompt (PC) and make sure to be in the folder where you copied biosemi2ft, then execute:

biosemi2ft <config_file> <gdf-file> <hostname> <port>

The biosemi2ft software supports fieldtrips Online Data Manager, which allows for a remotely configuration of streamed/saved channels and filter settings. BrainStream supports this feature and in order to use it, define the configureFile key for corresponding hardware devices topic in the blocksettings. Also enable this feature by setting the OnlineDataManager key to 1, and make sure the remotePort key is set to the same port value specified at startup of biosemi2ft. BrainStream will then send these configuration settings to the interface software along with a name for the gdf-file saving the raw data. Note that this name doesn't include path information and therefore data is stored in the folder where biosemi2ft resides.

[biosemi_active2] 
configureFile = 'biosemi_active2_cap64.cfg'
!OnlineDataManager = 1 
remotePort = 8000 
startFunction = 'cleanup'
stopFunction = 'copy_rawdata'

If the interfacing software xxx2ft does not support the Online Data Manager, make sure to set the OnlineDataManager key to 0 (default).

BrainStreams offers the option to specify functions that execute either before starting or after stopping streaming data from the hardware device. Use the startFunction and stopFunction key for corresponding hardware devices topic. This is for example useful to have those functions start the interfacing software automatically or take care of copying the acquired gdf-file to some dedicated location. Those functions should take the form:

function my_custom_startFunction(datasource,device) 
% datasource: your reference name of the data source (in the example above: eeg)
% device: name referring to the hardware device (in the example above: biosemi_active2) 
% add code to handle specific tasks, required in your lab before connecting to the fieldtrip buffer

function my_custom_stopFunction(datasource,device) 
% datasource: your reference name of the data source (in the example above: eeg)
% device: name referring to the hardware device (in the example above: biosemi_active2) 
% add code to handle specific tasks, required in your lab after completing a block  

9.3. Add the BrainStream core folder to the Matlab path

Matlab path must include BrainStream s core folder, any further required BrainStream folders will be added by BrainStream.

Either save BrainStreams core folder to Matlabs path permanently by choosing Set Path in the file menu, or make sure your working directory is at the BrainStream core folder.

During runtime, any other folders that need to be added to the Matlab path can be handled by block file settings for the Experiment topic. The keys MatlabPathAdd and MatlabPathFnc take care of this. Specify a string cell array with folders to add (they always add recursively), or specify a function that adds folders to the Matlab path. When specific plugins require access to Java classes from within BrainStream, this function should then also add these to the Matlab's JavaClassPath.

9.4. Hardware markers

Click here to read how BrainStream processes incoming markers.
Click here to read what options users have to insert markers. (to do: write it)

A major reason to use hardware instead of software markers is the fact that a better synchronization between presented stimuli and data can be achieved. Not all devices support solutions to insert markers by hardware, in that case you should send markers to the fieldtrip buffer directly. It depends on the specific implementaton of the xxx2ft interface software how accurate the synchronization with data will be. More specific, it depends on the size of the chunks of data constantly being updated to the buffer. For example, biosemi2ft standardly updates the buffer with chunks of data sized approximately 15 samples. In that case, a marker directly sent to the buffer would synchronize data with approximately 7.3 ms accuracy (sample rate 2048 Hz), instead of 0.5 ms when sent to the hardware (1 sample). For online experiments that in general use much lower sample rates, the difference between the two reduces considerably. These differences are especially relevant to experiment designs susceptible to accurate timing.
Users should always use BrainStreams sndMarker function to send hardware markers, it will read from the blocksettings which function to use for the hardware device the marker should be sent to.

A custom sndMyMarker function responsible for actually sending markers to some specific hardware should obey following format:

function [event, ret] = sndMyMarker(event,m)
% m.name     = name of marker
% m.type     = type marker
% m.value = marker value (type char!)
% ret > 0 if marker was sent successfully
try
    % check m.type and m.value
    % ...
    % use type and value to sent marker out to the hardware    
    % send_my_marker(m);
    ret = 1;
catch err
    ret = 0;
end
An example using a PC's COMM port looks like this:
function [event, ret] = sndCOMMarker(event,m)
mlock
persistent serobjw
if isempty(serobjw)
   serobjw = serial('COM1');              % Creating serial port object
   serobjw.Baudrate = 115200;             % Set the baud rate at the specific value
   set(serobjw, 'Parity', 'none');        % Set parity as none
   set(serobjw, 'Databits', 8);           % set the number of data bits
   set(serobjw, 'StopBits', 1);           % set number of stop bits as 1
   set(serobjw, 'Terminator', '');        % set the terminator value to newline
   set(serobjw, 'OutputBufferSize', 512); % Buffer for write
end
try
   fopen(serobjw);
   fwrite(serobjw,str2double(m.value)); % write to serial port
   fclose(serobjw); % close it
   ret = 1;
catch err 
   event = bs_warn(event,err.message);
   disp(err.message);
   ret = 0;
end


 

9.5. Firewall settings

BrainStream uses ports 5001 and 5002 to connect to possible Matlab clients. Furthermore, BrainStream uses ports 1972 and further (dependent of the number of required file proxies) to connect to buffers that stream acquired data, simulated data or from file replayed data, or to install buffers related to BrainStreams pre-processing option. Make sure these ports are not blocked by your firewall.

9.6. Test BrainStream

 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback