Changes

Jump to navigation Jump to search
Line 130: Line 130:     
If the outcome of the decision is that another sequence should be displayed, the marker start_sequence will be inserted. At the start of a new sequence, the variable <em>epoch_count </em>must be set to 0. Then BrainStream must wait for a button press from the participant, which is achieved by specifying timepoint 'button_1' for this event. The displaying of the characters is handled by the function displayString. This function will not be discussed in detail, but it is important to know that it requires the content of the variables <em>stimsequence </em>and<em> sequence_count.</em> Therefore, get statements must be specified for these variables. Now we have reached the next decision point in the experiment flowchart, where we need to decide whether to start a new epoch or end the sequence. We will insert marker ''next_epoch'' to trigger this decision making step.
 
If the outcome of the decision is that another sequence should be displayed, the marker start_sequence will be inserted. At the start of a new sequence, the variable <em>epoch_count </em>must be set to 0. Then BrainStream must wait for a button press from the participant, which is achieved by specifying timepoint 'button_1' for this event. The displaying of the characters is handled by the function displayString. This function will not be discussed in detail, but it is important to know that it requires the content of the variables <em>stimsequence </em>and<em> sequence_count.</em> Therefore, get statements must be specified for these variables. Now we have reached the next decision point in the experiment flowchart, where we need to decide whether to start a new epoch or end the sequence. We will insert marker ''next_epoch'' to trigger this decision making step.
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| '''<strong>marker</strong>''' || '''<strong>time</strong>''' || '''<strong>function</strong>''' || '''<strong>stimsequence</strong>''' || '''<strong>sequence_count</strong>''' || '''<strong>epoch_count</strong>'''  
 
| '''<strong>marker</strong>''' || '''<strong>time</strong>''' || '''<strong>function</strong>''' || '''<strong>stimsequence</strong>''' || '''<strong>sequence_count</strong>''' || '''<strong>epoch_count</strong>'''  
Line 149: Line 149:     
When the next_epoch marker comes in, first the epoch counter must be increased by 1. Subsequently, we need to write a function that uses the content of ''stimsequence'' and the current values of ''sequence_count'' and ''epoch_count'' to decide whether to start a new epoch. We will call this function <tt>nextEpoch</tt>. Because the function needs the content of all our variables as input, we must specify get statements for these variables. The Actions table now looks like this:
 
When the next_epoch marker comes in, first the epoch counter must be increased by 1. Subsequently, we need to write a function that uses the content of ''stimsequence'' and the current values of ''sequence_count'' and ''epoch_count'' to decide whether to start a new epoch. We will call this function <tt>nextEpoch</tt>. Because the function needs the content of all our variables as input, we must specify get statements for these variables. The Actions table now looks like this:
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| '''<strong>marker</strong>''' || '''<strong>time</strong>''' || '''<strong>function</strong>''' || '''<strong>stimsequence</strong>''' || '''<strong>sequence_count</strong>''' || '''<strong>epoch_count</strong>'''  
 
| '''<strong>marker</strong>''' || '''<strong>time</strong>''' || '''<strong>function</strong>''' || '''<strong>stimsequence</strong>''' || '''<strong>sequence_count</strong>''' || '''<strong>epoch_count</strong>'''  
Line 179: Line 179:  
</pre>If the outcome of the decision is that another character should be displayed, the marker proc_epoch will be inserted. As we want to use this marker for data selection (see [[BrainStreamExampleSentences#DataSelection|next section]), accurate synchronization between marker and data is required. Therefore, we will insert this marker [[BrainStreamMarkerHandling#HardwareMarker|via the hardware]. When this marker arrives, the displayString function will be used to show the current character. After this has been done, we insert the next_epoch marker and thereby return to the question whether to start another epoch. The next_epoch marker is inserted 0.25 seconds after the bs_send_buffer_marker function is called. As a result, there is a pause of approximately 0.25 seconds between the appearance of each character on the screen.
 
</pre>If the outcome of the decision is that another character should be displayed, the marker proc_epoch will be inserted. As we want to use this marker for data selection (see [[BrainStreamExampleSentences#DataSelection|next section]), accurate synchronization between marker and data is required. Therefore, we will insert this marker [[BrainStreamMarkerHandling#HardwareMarker|via the hardware]. When this marker arrives, the displayString function will be used to show the current character. After this has been done, we insert the next_epoch marker and thereby return to the question whether to start another epoch. The next_epoch marker is inserted 0.25 seconds after the bs_send_buffer_marker function is called. As a result, there is a pause of approximately 0.25 seconds between the appearance of each character on the screen.
   −
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| '''<strong>marker</strong>''' || '''<strong>time</strong>''' || '''<strong>function</strong>''' || '''<strong>stimsequence</strong>''' || '''<strong>sequence_count</strong>''' || '''<strong>epoch_count</strong>'''  
 
| '''<strong>marker</strong>''' || '''<strong>time</strong>''' || '''<strong>function</strong>''' || '''<strong>stimsequence</strong>''' || '''<strong>sequence_count</strong>''' || '''<strong>epoch_count</strong>'''  
Line 204: Line 204:     
When all epochs of a sequence have been processed, the <tt>nextEpoch</tt> function will insert the end_sequence marker. When this marker arrives, we immediately insert the next_sequence marker, thereby returning to the question whether to start another sequence. The next_sequence marker is inserted 1 second after the bs_send_buffer_marker function is called. As a result, there is a pause of approximately 1 second between each sequence. The Actions table now contains all the necessary steps of the experiment.
 
When all epochs of a sequence have been processed, the <tt>nextEpoch</tt> function will insert the end_sequence marker. When this marker arrives, we immediately insert the next_sequence marker, thereby returning to the question whether to start another sequence. The next_sequence marker is inserted 1 second after the bs_send_buffer_marker function is called. As a result, there is a pause of approximately 1 second between each sequence. The Actions table now contains all the necessary steps of the experiment.
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| '''<strong>marker</strong>''' || '''<strong>time</strong>''' || '''<strong>function</strong>''' || '''<strong>stimsequence</strong>''' || '''<strong>sequence_count</strong>''' || '''<strong>epoch_count</strong>'''  
 
| '''<strong>marker</strong>''' || '''<strong>time</strong>''' || '''<strong>function</strong>''' || '''<strong>stimsequence</strong>''' || '''<strong>sequence_count</strong>''' || '''<strong>epoch_count</strong>'''  
Line 238: Line 238:  
New epochs are started by the proc_epoch marker. We will therefore use this marker to trigger data selection. For now, we will only print the message 'Process the data' in the Matlab command window every time data is collected. However, instead of showing a simple message you could also write functions to actually process the data. This is the new Actions table:
 
New epochs are started by the proc_epoch marker. We will therefore use this marker to trigger data selection. For now, we will only print the message 'Process the data' in the Matlab command window every time data is collected. However, instead of showing a simple message you could also write functions to actually process the data. This is the new Actions table:
   −
{| border="1"
+
{|class="wikitable"
 
|-
 
|-
 
| '''<strong>marker</strong>''' || '''<strong>time</strong>''' || '''<strong>function</strong>''' || '''<strong>stimsequence</strong>''' || '''<strong>sequence_count</strong>''' || '''<strong>epoch_count</strong>'''  
 
| '''<strong>marker</strong>''' || '''<strong>time</strong>''' || '''<strong>function</strong>''' || '''<strong>stimsequence</strong>''' || '''<strong>sequence_count</strong>''' || '''<strong>epoch_count</strong>'''  
Line 267: Line 267:     
We also need a [.DocsSectionsBuildingExperiments#SecDataSel DataSelection table] to specify the exact time window of data selection. If we want to record one second of data after the onset of each epoch, our DataSelection table looks like this:
 
We also need a [.DocsSectionsBuildingExperiments#SecDataSel DataSelection table] to specify the exact time window of data selection. If we want to record one second of data after the onset of each epoch, our DataSelection table looks like this:
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| '''marker''' || '''begintime''' || '''endtime''' || '''datasource'''  
 
| '''marker''' || '''begintime''' || '''endtime''' || '''datasource'''  
Line 279: Line 279:     
The [.DocsSectionsBuildingExperiments#SecDict Dictionary table] specifies a marker number for each marker that is used in this experiment. The Dictionary table looks like this:
 
The [.DocsSectionsBuildingExperiments#SecDict Dictionary table] specifies a marker number for each marker that is used in this experiment. The Dictionary table looks like this:
{| border="1"
+
{| class="wikitable"
 
|-
 
|-
 
| '''marker''' || '''type''' || '''value''' || '''datasource'''  
 
| '''marker''' || '''type''' || '''value''' || '''datasource'''  

Navigation menu