= Tutorial 9: Processes = This tutorial uses Sabine Meunier's somatotopy experiment, called ''TutorialCTF ''in your Brainstorm database. The ''Processes ''tab in Brainstorm window is a very generic tool that can be used to apply a function or extract data from any set of data files (recordings or sources). Its main applications are: pre-processing, averaging, and data extraction. <> == Files to process == First, you have to select the files you want to process. You can drad'n'drop any node that contains recordings or sources from the database explorer to the ''Processes ''list. * Click on sources file: Subject01 / !StimRightThumb / ERP / MN:MEG(Kernel). Drag'n'drop it to the empty list in ''Processes ''list. * Click on condition: Subject01 / !StimLeftThumb. Add it to the list. * Click alternatively on the ''Sources'' and ''Recordings'' buttons in the ''Processes'' tab. This indicates if you are going to process sources or recordings files. Observe that the number of files (the numbers indicated in brackets) changes according to the modality selected.<
><
> {{attachment:panelProcesses.gif}} * Note that you can put almost anything in this list: recordings, sources, conditions, subjects, even the whole procotol. It will take recursively all the recordings or sources files that are contained in each node. == Process selection == * Select ''Sources''. Click on ''Run''. This big window appears:<
><
> {{attachment:panelStatRun.gif}} * '''Processes selection''': list of processes available for the selected data: * __Process files__: One input file => one output file * '''Z-score noise normalization''': For each input file, substract the average and divide by the variance of the baseline. * '''Remove baseline mean (DC offset)''': For each input file, substract the average of the baseline. * '''Bandpass filtering''': Hi-pass, low-pass, band-pass filtering using the Signal Processing Toolbox. * '''Spatial smoothing''': Smooth the sources activations on the cortex surface. Useful before comparing different runs or different subjects, to correct possible small errors of localization. * '''Opposite values''': Just replace the input values with their opposite * __Averaging__: Many input files => a few averaged output files * '''Average by condition''': One output for each condition (ie. grand average) * '''Average by subject''': One output for each subject * '''Average everything''': One output file only * __Extract data__: Get a structured subset of the input data (sources, scouts, clusters, ...) * '''Average over a time window''': Select a block of data in each input file, and average over the time dimension. * '''Variance over a time window''': Same, but get the variance instead of the mean. * '''Extract data block''': Select a block of data in each input file. * '''Time windows''': * __Time window__: Define the time instants that will be processed. * __Baseline__: Some processes require the definition of a baseline / pre-stimulus time window for all the input files. * '''Sources''': * Use absolute values of sources activations. If checked, the process will be applied on the absolute values of the input files, instead of the initial values.<
>This is usually indispensable when processing sources amplitudes, as the relative values given by the minimum estimation are not really meaningful. * '''Scouts''': * When scouts are available in the "Scout" tab of the Brainstorm interface, they also appear here. * Check the "Use only selected scouts" if you want to compute only the scouts time series instead of extracting all the sources time series. * Check the "Merge selected scouts" if you want the selected scouts to be concatenated and considered as only one big scout. * '''Output''': * __Brainstorm database__: The results of the processes are stored in new files that will appear in the Brainstorm database explorer. <
>This option is not always available, because some processes produce output that are not compatible with Brainstorm database structure. Example: If you extract the average of a scout over a certain time window, this cannot be stored in the database. * '''Overwrite initial files''': Check this option if you are applying pre-processing functions on recordings and if you don't want to keep the original files. * '''Select output condition''': A meaningful default path (Subject/Condition) to store the output files is usually selected by the program, according to the process and files processed. <
>Check this option if you want to override Brainstorm's default, and enter you own output path. * __User defined file__: Store all the output information in one unique file, that has to be located ''__outside__'' of the Brainstorm database folder. * Possible output formats: Matlab .mat, or ASCII matrices * This options is usually useful if you are are extracting blocks of information that you want to process later with another software (R, Excel, Statistica), or with your own Matlab scripts. * For example: Extract 5 time windows x 3 scouts x 10 conditions x 60 subjects => You would have to start 5 times only the process and create 5 different files. * __Export to a Matlab variable__: Produce exactly the same output as the previous option, but export it directly into the current Matlab workspace instead of saving it to a file. == Examples == === Z-Score noise normalization === * Keep the file selection done at the beginning of this tutorial. Select the "z-score noise normalization" process. * Set the baseline to [-49.6, -12]ms (after 12ms, the values are linear interpolations due to the electric stimulation artifac removal) * Leave the other options to their default values. Click on Run. Wait until the progress bar disappears. * Have a look to the database explorer: Two new files appeared, one for each input sources file.<
> {{attachment:ex1_db.gif}} * For StimRightThumb: open the ERP time series, the original sources, and the zscore.<
> {{attachment:ex1_ts.gif}} {{attachment:ex1_sources.gif}} {{attachment:ex1_zscore.gif}} * Notice that the two cortical views are displayed with different colorbars. * The initial minimum norm result is shown in pA.m (amplitude range around 10e-12), with the the "sources" colormap. * The z-score values are shown without any unit, with the "stat" colormap. At a given time, a value of 20 for a given source means that its amplitude is 20 times superior to its average amplitude during the baseline. === Scout time serie === * Close all the windows * == Next == This is the end of the first tutorial, based on CTF MEG recordings. Other important notions are going to be introduced in a tutorial based on EEG data : clusters of electrodes, and statistical analysis. But please go again through all the importation / anatomy definition