= Tutorial 16: Average response = ''Authors: Francois Tadel, Elizabeth Bock, Sylvain Baillet'' All the epochs we have imported in the previous tutorial are represented by matrices that have the same size (same number of channels, same number of time points), therefore they can be averaged together by experimental condition. The result is called indifferently "'''evoked response'''", "'''average response'''", "'''event-related field'''" in MEG (ERF) or "'''event-related potential'''" in EEG (ERP). It shows the components of the brain signals that are strictly time-locked to the presentation of a stimulus. <> == Averaging runs separately == We will now compute the average responses for both the "standard" and "deviant" conditions, for each acquisition run separately. Note that in MEG, it is not recommended to average across acquisition runs which correspond to different head positions (ie. different "channel files"). If the head of the subject moved between two blocks of recordings, one sensor does not record the same part of the brain before and after, therefore the runs cannot be compared directly. * Drag and drop all the "'''standard'''" and "'''deviant'''" trials for '''both runs''' in Process1. * In the Process1 list, you can notice that the number of imported trials, for instance "(40 files)" does not match the number of files selected for processing (between brackets, eg. "[39]"). This difference is due to the '''bad trials''' that we have in these folders. The trials tagged with a red dot in the database explorer are ignored by all the processes. The total number of selected files is 458 instead of 480, it means that we have a total of 22 bad trials. * Select the process "'''Average > Average files'''". <
>Select: By trial group (folder average), Arithmetic average, Keep all the event markers.<
><
> {{attachment:average_folder.gif||height="529",width="504"}} * You get two new files for each average: <
><
> {{attachment:average_files.gif||height="224",width="241"}} == Process options == Description of all the options of the process: * '''Everything''': Averages all the files selected in Process1 together, creates only one file in output. * '''By subject''': Groups the files by subject (ignoring the folders), creates one file per subject. * '''By folder (subject average)''': Groups by subject and by folder, ignoring the trial groups. <
>In the current configuration, it would produce two files, one for each acquisition run. * '''By folder (grand average)''': Groups by folder, across the subjects. All the files located in folders with the same name would be averaged together, no matter in what subject they are. * '''By trial group (folder average)''': Groups by set of trials with the same name, separately for each folder and each subject. * '''By trial group (subject average)''': Groups by set of trials with the same name, for each subject. The separation in folders is ignored. In the current configuration, it would produce two files, one for "deviant" and one for "standard". * '''By trial group (grand average)''': Groups by set of trials with the same name, ignoring the classification by folder or subject. * '''Function''': Documented directly in the option panel. * '''Keep all the event markers''': If this option is selected, all the event markers that were available in all the individual trials are reported to the average file. It can be useful to check the relative position of the artifacts or the subject responses, or quickly detect some unwanted configuration such as a subject who would constantly blink immediately after a visual stimulus. == Visual exploration == The average response contains interesting information about the brain operations that occur shortly after the presentation of the stimulus. We can explore two dimensions: the '''location''' of the various brain regions involved in the sensory processing and the precise '''timing''' of their activation. Because these two types of information are of equal interest, we typically explore the recordings with two figures at the same time, one that shows all the signals in time, one that shows the spatial distribution at one instant. * Open the MEG recordings for the '''deviant average''' in '''Run#01''': double-click on the file. * In the Record tab: Select the "butterfly" view more (first button in the toolbar). * In the Filter tab: Add a '''low-pass filter''' at '''100Hz'''. * In the Record tab: Delete the "cardiac" event type, we are not interested by their distribution.<
><
> {{attachment:deviant_ts.gif||height="176",width="661"}} * This figure shows a typical an clean evoked response, with a high signal-to-noise ratio. This represents the brain response to a simple auditory stimulation, the large peak around '''90ms''' probably corresponds to the main response in the primary auditory cortex. * The green line represents the global field power ('''GFP'''), ie the sum of the square of all the sensors at each time point. This measure is sometimes used to identify transient or stable states in ERP/ERF. * This is the response to the deviant beeps (clearly higher in pitch), for which the subject is supposed to press a button to indicate that he/she detected the target. These responses are represented with the "button" events, distributed between 350ms and the end of the file (many responses happened after 500ms). Because of the variability in the response times, we can already anticipate that we won't be able to study correctly the motor response from this average. For studying the activity in the motor area, we need to epoch again the recordings around the "button" events. Add a spatial view: * Open a 2D topography for the same file (right-click on the figure > View topography, or Ctrl+T). * Review the average '''as a movie''' with the keyboard shortcuts (hold the left or right arrow key). * At '''90ms''', we can observe a typical topography for a bilateral auditory response. Both on the left sensors and the right sensors we observe field patterns which seem to indicate a dipolar-like activity in the temporal or central regions. <
><
> {{attachment:deviant_topo.gif||height="136",width="159"}} * Close everything with the button [X] in the top-right corner of the Brainstorm window. <
>Accept to save the modifications (you deleted the "cardiac" events). Repeat the same operations for '''Run#02''': * Open the MEG recordings. * Delete the "cardiac" markers. * The average is cleaner because it was computed from many more trials, but it also contains more unwanted things: a few blinks and probably an error from the subject. The "button" marker at 136ms is not supposed to be here. The task is so easy that we can probably assume that it is not a real detection error but rather a manipulation error, therefore it should not affect the cortical response in the very early stages of the stimulus processing, which is what we are exploring now. * Open a 2D topography and review the recordings. * Close everything. == Interpretation == Let's display the two conditions "'''standard'''" and "'''deviant'''" side-by-side, for '''Run#01'''. * Right-click on average > MEG > Display time series. * Right-click on average > MISC > Display time series (EEG electrodes Cz and Pz) * Right-click on average > MEG > 2D Sensor cap * In the Filter tab: add a '''low-pass filter''' at '''100Hz'''. * In the Record tab: you can set a common amplitude scale for all the figures with the button '''[=]'''. * Here are the results for the standard (top) and deviant (bottom) beeps: <
><
> {{attachment:average_summary.gif||height="371",width="663"}} The legend in blue shows names often used in the EEG ERP literature: * '''P50''': 50ms, bilateral auditory response in both conditions. * '''N100''': 95ms, bilateral auditory response in both conditions. * '''MMN''': 100-200ms, mismatch negativity in the deviant condition only (detection of an abnormality). * '''P200''': 170ms, in both conditions but much stronger in the standard condition. * '''P300''': 300-400ms, deviant condition only (decision making in preparation of the button press). <> == Averaging across runs == As said previously, it is usually not recommended to average recordings in sensor space across multiple acquisition runs because the subject might have moved between the sessions. Different head positions were recorded for each run, we will reconstruct the sources separately for each each run to take into account these movements. However, in the case of event-related studies it makes sense to start our data exploration with an average across runs, just to evaluate the quality of the evoked responses. We have seen in tutorial #4 that the subject almost didn't move between the two runs, so the error would be minimal. . {{http://neuroimage.usc.edu/brainstorm/Tutorials/ChannelFile?action=AttachFile&do=get&target=channel_multiple.gif|channel_multiple.gif|height="218",width="438",class="attachment"}} Let's compute an approximate average across runs. We will run a formal average in source space later. * To run again the same process with different parameters: '''File > Reload last pipeline'''. Select: * '''By trial group (subject average)''': It will compute one average per experimental condition. * '''Arithmetic average + Standard error''': It will save in the same file the average and the standard error across all the trials. Illustrated in the next section. * '''Keep all the event markers''': Do not select this option, we've already seen what it does. * The two files that are created are now saved in a new folder "'''Intra-subject'''". This is where all the results of processes involving multiple folders within one subject will be saved.<
><
> {{attachment:average_stderror.gif||height="184",width="219"}} <> == Standard error == If you computed the '''standard deviation''' or the '''standard deviation''' together with an average, it will be represented automatically in the time series figures. * Double-click on one of the AvgStderr files to display the MEG sensors.<
>The light-grey area around the sensors represent the maximum standard error around the maximum and minimum values across all the sensors. * Select two sensors and plot them separately (right-click > Channels > View selected, or "Enter").<
>The green and red areas represent at each time point the standard error around the signal.<
><
> {{attachment:stderror.gif||height="176",width="379"}} * Right-click on the file > '''File > View file contents'''. <
>The average is saved in the field '''F''', the standard error is saved in the field '''Std'''.<
><
> {{attachment:stderror_file.gif||height="230",width="396"}} <)>> <> <>