Changes

Jump to navigation Jump to search
Line 15: Line 15:  
The Actions table specifies the actions that should be executed for each marker. Table 1 is an example of an Actions table:
 
The Actions table specifies the actions that should be executed for each marker. Table 1 is an example of an Actions table:
   −
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| <strong>marker</strong> || <strong>time</strong> || <strong>function</strong> || <strong>feval</strong> || <strong>looptick</strong> || <strong>client</strong>  
 
| <strong>marker</strong> || <strong>time</strong> || <strong>function</strong> || <strong>feval</strong> || <strong>looptick</strong> || <strong>client</strong>  
Line 31: Line 31:  
The second column (time) specifies at which timepoints, relative to the time of the incoming marker, the actions should be executed. The exact timing of execution can be specified in several ways. The action can be executed directly at marker onset, when a certain amount of data becomes available, some time after the marker, or when another marker arrives (see table 2). For example, table 1 specifies that functions fnc1 and fnc2 are executed at the onset of marker mrk1 whereas function fnc3 takes place one second after marker onset.
 
The second column (time) specifies at which timepoints, relative to the time of the incoming marker, the actions should be executed. The exact timing of execution can be specified in several ways. The action can be executed directly at marker onset, when a certain amount of data becomes available, some time after the marker, or when another marker arrives (see table 2). For example, table 1 specifies that functions fnc1 and fnc2 are executed at the onset of marker mrk1 whereas function fnc3 takes place one second after marker onset.
   −
<table bgcolor="#ffffff" cellpadding="3" border="1"><tr><td> '''EVENT''' <br /> '''DATA''' <br /> a ''number'' <br /> another ''mrk'' <br /> </td> <td> Executed at marker onset <br /> Executed as data becomes available <br /> Executed ''number'' seconds ''after'' marker onset <br /> Executed at onset of marker ''mrk'' </td></tr></table>
+
<table bgcolor="#ffffff" cellpadding="3" class="wikitable"><tr><td> '''EVENT''' <br /> '''DATA''' <br /> a ''number'' <br /> another ''mrk'' <br /> </td> <td> Executed at marker onset <br /> Executed as data becomes available <br /> Executed ''number'' seconds ''after'' marker onset <br /> Executed at onset of marker ''mrk'' </td></tr></table>
    
<em>Table 2: Specifying time of action execution<br /></em>
 
<em>Table 2: Specifying time of action execution<br /></em>
Line 42: Line 42:     
<div id="SecTrigger"></div>
 
<div id="SecTrigger"></div>
 +
 
=== Trigger table ===
 
=== Trigger table ===
 
While actions give meaning to the events, the Trigger table implements the logic of the experiment program flow. It defines how each event possibly triggers the execution of other events. Conditional expressions implement runtime dependent triggered events, made possible by allowing global variables to be used in these expressions. An example would be to either trigger the <tt>next_trial</tt> event or <tt>next_sequence</tt> event based on the current state of the <tt>num_acquired_trials</tt> variable. Table 3 demonstrates corresponding Trigger table.
 
While actions give meaning to the events, the Trigger table implements the logic of the experiment program flow. It defines how each event possibly triggers the execution of other events. Conditional expressions implement runtime dependent triggered events, made possible by allowing global variables to be used in these expressions. An example would be to either trigger the <tt>next_trial</tt> event or <tt>next_sequence</tt> event based on the current state of the <tt>num_acquired_trials</tt> variable. Table 3 demonstrates corresponding Trigger table.
   −
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| <strong>marker</strong> || <strong>time</strong> || <strong>fire</strong> || <strong>datasource</strong> || <strong>delay</strong>  || <strong>condition</strong>  || <strong>triggeraction</strong>  
 
| <strong>marker</strong> || <strong>time</strong> || <strong>fire</strong> || <strong>datasource</strong> || <strong>delay</strong>  || <strong>condition</strong>  || <strong>triggeraction</strong>  
Line 71: Line 72:  
The DataSelection table consists of a marker column, a begindata column, and an enddata column. Data selection may start before or after onset of the marker, indicated by negative and positive numbers respectively. The end of data selection can be before or after the onset of the marker specified in the marker column, when a new marker arrives (with or without extra timing), or when nothing happens for a specified period of time (timeout). If multiple endtimes, seperated by a comma, are specified, the one that happens first will end the data selection.
 
The DataSelection table consists of a marker column, a begindata column, and an enddata column. Data selection may start before or after onset of the marker, indicated by negative and positive numbers respectively. The end of data selection can be before or after the onset of the marker specified in the marker column, when a new marker arrives (with or without extra timing), or when nothing happens for a specified period of time (timeout). If multiple endtimes, seperated by a comma, are specified, the one that happens first will end the data selection.
   −
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| <strong>marker</strong> || <strong>begintime</strong> || <strong>endtime</strong> || <strong>datasource</strong>  
 
| <strong>marker</strong> || <strong>begintime</strong> || <strong>endtime</strong> || <strong>datasource</strong>  
Line 100: Line 101:  
The datasource column is optional. If multiple data sources are used in the experiment, the datasource column specifies for which data source the dictionary information is meant. If only one datasource is involved, this column can be left out and BrainStream will apply the definitions to the single data source.
 
The datasource column is optional. If multiple data sources are used in the experiment, the datasource column specifies for which data source the dictionary information is meant. If only one datasource is involved, this column can be left out and BrainStream will apply the definitions to the single data source.
   −
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| <strong>marker</strong> || <strong>type</strong> || <strong>value</strong> || <strong>datasource</strong>  
 
| <strong>marker</strong> || <strong>type</strong> || <strong>value</strong> || <strong>datasource</strong>  
Line 128: Line 129:  
If a function needs a user defined variable, you first need to get it from the [[BrainStreamImportantConcepts#SecVariables|global variables]]. This is done by putting a &lsquo;get&rsquo; statement in the corresponding cell. For example, consider the following Actions table:
 
If a function needs a user defined variable, you first need to get it from the [[BrainStreamImportantConcepts#SecVariables|global variables]]. This is done by putting a &lsquo;get&rsquo; statement in the corresponding cell. For example, consider the following Actions table:
   −
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| <strong>marker</strong> || <strong>time</strong> || <strong>function</strong> || <strong>feval</strong> || <strong>looptick</strong> || <strong>client</strong> || <strong>var1</strong> || <strong>........</strong> || <strong>varN</strong>  
 
| <strong>marker</strong> || <strong>time</strong> || <strong>function</strong> || <strong>feval</strong> || <strong>looptick</strong> || <strong>client</strong> || <strong>var1</strong> || <strong>........</strong> || <strong>varN</strong>  
Line 154: Line 155:     
In the ''feval'' column, you can specify functions that do not process any of the user defined variables. Examples are Matlab's <tt>[[Http://www.mathworks.nl/help/techdoc/ref/tic.htmlTic|http://www.mathworks.nl/help/techdoc/ref/tic.html tic]]/[[Http://www.mathworks.nl/help/techdoc/ref/toc.htmlToc|http://www.mathworks.nl/help/techdoc/ref/toc.html toc]]</tt> or [[Http://www.mathworks.nl/help/techdoc/ref/disp.htmlDisp|http://www.mathworks.nl/help/techdoc/ref/disp.html disp]] functions. In the example below, <tt>tic</tt> and <tt>toc</tt> are used to evaluate the time it takes to execute function my_fnc1:
 
In the ''feval'' column, you can specify functions that do not process any of the user defined variables. Examples are Matlab's <tt>[[Http://www.mathworks.nl/help/techdoc/ref/tic.htmlTic|http://www.mathworks.nl/help/techdoc/ref/tic.html tic]]/[[Http://www.mathworks.nl/help/techdoc/ref/toc.htmlToc|http://www.mathworks.nl/help/techdoc/ref/toc.html toc]]</tt> or [[Http://www.mathworks.nl/help/techdoc/ref/disp.htmlDisp|http://www.mathworks.nl/help/techdoc/ref/disp.html disp]] functions. In the example below, <tt>tic</tt> and <tt>toc</tt> are used to evaluate the time it takes to execute function my_fnc1:
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| <strong>marker</strong> || <strong>time</strong> || <strong>function</strong> || <strong>feval</strong>  
 
| <strong>marker</strong> || <strong>time</strong> || <strong>function</strong> || <strong>feval</strong>  
Line 167: Line 168:     
In the following table, the execution time of multiple functions will be measured:
 
In the following table, the execution time of multiple functions will be measured:
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| <strong>marker <br /></strong> || <strong>time <br /></strong> || <strong>function <br /></strong> || <strong>feval <br /></strong>  
 
| <strong>marker <br /></strong> || <strong>time <br /></strong> || <strong>function <br /></strong> || <strong>feval <br /></strong>  
Line 182: Line 183:     
Functions specified in the feval column can take user defined variables as input arguments, as in the following example:
 
Functions specified in the feval column can take user defined variables as input arguments, as in the following example:
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| <strong>marker <br /></strong> || <strong>time <br /></strong> || <strong>function <br /></strong> || <strong>feval <br /></strong> || <strong>Var1 <br /></strong>  
 
| <strong>marker <br /></strong> || <strong>time <br /></strong> || <strong>function <br /></strong> || <strong>feval <br /></strong> || <strong>Var1 <br /></strong>  

Navigation menu