= Tutorial 27: Workflows = '''[TUTORIAL UNDER DEVELOPMENT: NOT READY FOR PUBLIC USE] ''' ''Authors: Francois Tadel, Elizabeth Bock, Dimitrios Pantazis, Richard Leahy, Sylvain Baillet'' This page provides some general recommendations for your event-related analysis. It is not directly related with the auditory dataset, but provides guidelines you should consider for any MEG/EEG experiment. We do not provide standard analysis pipelines for resting or steady state recordings yet, but we will add a few examples soon in the section [[http://neuroimage.usc.edu/brainstorm/Tutorials#Other_analysis_scenarios|Other analysis scenarios]] of the tutorials page. <> == What is your question? == The most appropriate analysis pipeline for your data depends on the question you are trying to answer. What is the objective you have with your data? * Contrast two experimental conditions across trials, for '''one single subject''' (within subject) * Files A: Single trials for condition A. * Files B: Single trials for condition B. * Use independent tests, or difference of averages. * Contrast two groups of subjects for one given experimental condition (between subjects) * Files A: Averages for group of subjects #1. * Files B: Averages for group of subjects #2. * Use '''independent tests''', or difference of averages. * Contrast two experimental conditions across multiple subjects (between subjects) * Files A: All subjects, average for condition A. * Files B: All subjects, average for condition B. * Use '''paired tests''' (= dependent tests), or average of differences. What are the dimensions you want to explore? * MEG/EEG recordings * Cortical sources: * Individual anatomy or template * Constrained (one value per vertex) or unconstrained (three values per grid point) * Full cortex or regions of interests * Time-frequency dimensions What level of precisions you want to get? * Averages / difference of averages * Identify statistically significant differences '''[TODO: WHEN TO USE WHAT]''' == Common pre-processing pipeline == All the event-related studies can start with the pipeline we've introduced in these beginners' tutorials. 1. Import the anatomy of the subject (or use a template for all the subjects). 1. Access the recordings: * Link the continuous recordings to the Brainstorm database. * Prepare the channel file: co-register sensors and MRI, edit type and name of channels. * Edit the event markers: fix the delays of the triggers, mark additional events. 1. Pre-process the signals: * Evaluate the quality of the recordings with a power spectrum density (PSD). * Apply frequency filters (low-pass, high-pass, notch). * Identify bad channels and bad segments. * Correct for artifacts with SSP or ICA. 1. Import the recordings in the database: epochs around some markers of interest. == EEG recordings == ==== Average ==== * Average the epochs across sessions and subjects: OK. * Electrodes are in the same standard positions for all the subjects (e.g. 10-20). ==== Within subject statistics ==== * '''A vs'''''' B''': * Never use an absolute value for testing recordings. * Parametric or non-parametric tests, independent, two-tailed, FDR-corrected. * Correct effect size (we identify correctly where and when the conditions are different). * Ambiguous sign (we cannot say which condition is stronger). ==== Between subjects statistics ==== * '''(A-B=0)''': Parametric or non-parametric tests, two-tailed, FDR-corrected. == MEG recordings == ==== Average ==== * Average the epochs within each session: OK. * Averaging across sessions: Not advised because the head of the subject may move between runs. * Averaging across subjects: Strongly discouraged because the shape of the heads vary but the sensors are fixed. * Tolerance for data exploration: averaging across runs and subjects can be useful for identifying time points and sensors with interesting effects but should be avoided for formal analysis. * Note for Elekta/MaxFilter users: You can align all sessions to a reference session, this will allow direct channel comparisons within-subject. Not recommended across subjects. ==== Within subject statistics ==== * '''A = ''''''B''' * Never use an absolute value for testing recordings. * Parametric or non-parametric tests, independent, two-tailed, FDR-corrected. * Correct effect size (we identify correctly where and when the conditions are different). * Ambiguous sign (we cannot say which condition is stronger). ==== Between subjects statistics ==== * Not recommended with MEG recordings: do your analysis in source space. == Constrained cortical sources == ==== Within-subject average ==== 1. '''Sensor average''': Compute one sensor-level average''' '''per acquisition session and condition (MEG/EEG). <
>Use the '''same number of trials''' for all the averages. 1. '''Sources''': Estimate sources for each session average (constrained or unconstrained, no normalization). 1. '''Source average''': Average the source-level session averages to get one subject average. 1. <)>>'''Low-pass filter''' < 40Hz for evoked responses (optional)<)>> 1. '''Normalize '''the subject min-norm averages: Z-score vs. baseline (no absolute value). 1. '''Do not rectify the cortical maps''', but display them in absolute values. ==== Between-subjects average ==== 1. '''Subject average'''s: Compute the within-subject averages for all the subjects, as described just above. 1. '''Rectify''' the cortical maps (apply an absolute value). <
>Justification: Cortical maps have ambiguous signs across subjects: reconstructed sources depend heavily on the orientation of true cortical sources. Given the folding patterns of individual cortical anatomies vary considerably, cortical maps have subject-specific amplitude and sign ambiguities. This is true even if a standard anatomy is used for reconstruction. 1. '''Project '''the individual source maps on a template. 1. '''Smooth '''spatially the sources.<
>Justification: The effects observed with constrained cortical maps may be artifically very focal and not overlapping very well between subjects. Smoothing the cortical maps may help the activated regions overlap between subjects. 1. '''Group average''': Compute grand averages of all the subjects. ==== Between-subject difference of average ==== 1. '''Subject averages''': For each subject, compute the within-subject averages for conditions A and B, as described just above. 1. '''Subject difference''': Compute the difference between conditions for each subject (A-B). 1. '''Rectify''' the difference of source maps (apply an absolute value). 1. '''Project '''the individual difference on a template. 1. '''Smooth '''spatially the sources. 1. '''Group average''': Compute grand averages of all the subjects. ==== Within-subject statistics ==== 1. '''Sources''': Compute source maps for each trial (constrained or unconstrained, no normalization) 1. '''Statistics''': Compare all the trials of condition A vs all the trials of condition B.<
>Use as many trials as possible for A and B: No need to have an equal number of trials. 1. '''A = B''' * '''Parametric''' or '''non-parametric''' tests, independent, two-tailed, FDR-corrected. * Correct effect size: We identify correctly where and when the conditions are different. * Ambiguous sign: We cannot say which condition has the stronger response. 1. '''|A| = |B|''' * '''Non-parametric''' tests only, independent, two-tailed, FDR-corrected. * Incorrect effect size: Doesn't detect correctly the effects when A and B have opposite signs. * Correct sign: We can identify correctly which condition has a stronger response. ==== Between-subject statistics ==== 1. '''Sources''': Compute source maps for each trial (constrained or unconstrained, no normalization) 1. '''First-level statistic''': Compute a t-statistic for the source maps of all the trials A vs. all the trials B. * Process2: "Test > Parametric test: Independent": t-test with equal variance * Use as many trials as possible for A and B: No need to have an equal number of trials. * With a relatively high number of trials, we can consider the t-values follow a Z-distribution. 1. '''Second-level statistic''': Compute a one-sampled power test based on the subject t-statistic. * Process1: "Test > Parametric test against zero": One-sampled Chi-square test * This tests for '''|A-B|'''=0 using a power test: X = sum(|ti|^2) ~ Chi-square distribution * Correct effect size, no sign (cannot detect which condition has the strongest response). ==== Design consideration ==== * Use within-subject designs whenever possible (i.e. collect two conditions A and B for each subject), then contrast data within subject before comparing data between subjects. Such designs are not only statistically optimal, but also ameliorate the between-subject sign ambiguities as contrasts can be constructed within each subject. == Regions of interest (scouts) == * Even within-subject cortical maps have sign ambiguities. MEG has limited spatial resolution and sources in opposing sulcal/gyral areas are reconstructed with inverted signs (constrained orientations only). Averaging activity in cortical regions of interest (scouts) would thus lead to signal cancelation. To avoid this brainstorm uses algorithms to manipulate the sign of individual sources before averaging within a cortical region. Unfortunately, this introduces an amplitude and sign ambiguity in the time course when summarizing scout activity. * As a result, '''perform any interesting within-subject average/contrast before computing an average scout time series'''. == Within-subject statistics == For one unique subject, test for significant differences between two experimental conditions: * Compare the '''single trials''' corresponding to each condition. * In most cases, you '''do not need to normalize''' the data. * For help with the implications of testing the '''relative or absolute values''', see: [[Tutorials/Difference|Difference]]. ==== Unconstrained source maps ==== * Three values per vertex. * Use the non-normalized minimum norm maps for all the trials (current density maps, no Z-score). * We need to test the '''norm '''of the three orientations instead of testing the orientations separately. * '''Norm(A) vs. Norm(B)''': * Null hypothesis H0: (|A|=|B|). * '''Non-parametric''' tests only, independent, two-tailed, FDR-corrected. * Incorrect effect size, meaningful sign. ==== Regions of interest (scouts) ==== * Average/constrast cortical maps before summarizing scout activity. * Then consider as constrained or unconstrained source maps. ==== Time-frequency maps ==== * Test the non-normalized time-frequency maps for all the trials (no Z-score or ERS/ERD). * The values tested are power or magnitudes, all positive, so (A=B) and (|A|=|B|) are equivalent. * '''|A| vs |B|''': * Null hypothesis H0: (|A|=|B|) * '''Non-parametric''' tests only, independent, two-tailed, FDR-corrected. * Correct effect size, meaningful sign. == Between-subject statistics [TODO] == ==== Subject averages ==== You need first to process the data separately for each subject: 1. Compute the ''' subject-level averages''', using the '''same number of trials''' for each subject.<
> Sources: Average the non-normalized minimum norm maps (current density maps, no Z-score). 1. Sources and time-frequency: '''Normalize '''the data to bring the different subjects to the same range of values (Z-score normalization with respect to a baseline - never apply an absolute value here). 1. Sources computed on individual brains: '''Project '''the individual source maps on a template (see the [[Tutorials/CoregisterSubjects|coregistration tutorial]]). Not needed if the sources were estimated directly on the template anatomy. <
>Note: We evaluated the alternative order (project the sources and then normalize): it doesn't seem to be making a significant difference. It's more practical then to normalize at the subject level before projecting the sources on the template, so that we have normalized maps to look at for each subject in the database. 1. Constrained sources: '''Smooth '''spatially the sources, to make sure the brain responses are aligned. '''Problem''': This is only possible after applying an absolute value, smoothing in relative values do not make sense, as the positive and negative signals and the two sides of a sulcus would cancel out. [TODO] ==== Paired tests ==== * '''Constrained source maps''' (one value per vertex): * '''(A-B=0)''': Parametric or non-parametric tests, two-tailed, FDR-corrected ('''sign issue?'''). * '''(|A|-|B|=0)''': Non-parametric tests, two-tailed, FDR-corrected. * '''(|A-B| = 0)''': ??? * '''Unconstrained source maps''' (three values per vertex): * '''(Norm(A-B)=0)''': Non-parametric tests, __'''one-tailed'''__ (non-negative statistic), FDR-corrected. * '''(Norm(A)-Norm(B)=0)''': Non-parametric tests, two-tailed, FDR-corrected. * '''Time-frequency maps''': * '''(|A|-|B|=0)''': Non-parametric tests, two-tailed, FDR-corrected. * '''Regions of interest''' (scouts): * Comparison of scout time series between subjects is tricky because there is no way to avoid sign ambiguity for different subjects. Thus there are no clear recommendations. Rectifying before comparing scout time series between subjects can be a good idea or not depending on different cases. Having a good understanding of the data (multiple inspections across channels/sources/subjects) can offer hints whether rectifying the scout time series is a good idea. Using unconstrained cortical maps to create the scout time series can ameliorate ambiguity concerns. * For help with '''relative/absolute options''', read the previous tutorial: [[Tutorials/Difference|Difference]]. ==== Averages ==== * In order to compute grand averages (across subjects), you should '''rectify''' your source maps before averaging. Averaging the absolute values of the subject-level averages will help avoiding possible cancellation effects due to anatomical differences between subjects. * If you have two conditions A and B to contrast, first compute the difference within-subject (A-B), then average the rectified differences: average_subjects(|Ai-Bi|). <> == Workflow: Current problems [TODO] == The following inconsistencies are still present in the documentation. We are actively working on these issues and will update this tutorial as soon as we found solutions. * [Group analysis] Unconstrained sources: How to compute a Z-score? * Zscore(A): Normalizes each orientation separately, which doesn't make much sense. * Zscore(Norm(A)): Gets rid of the signs, forbids the option of a signed test H0:(Norm(A-B)=0) * See also the tutorial: [[http://neuroimage.usc.edu/brainstorm/Tutorials/SourceEstimation#Z-score|Source estimation]] * We would need a way to normalize across the three orientations are the same time. * [Group analysis] Constrained sources: How do we smooth? * Group analysis benefits a lot from smoothing the source maps before computing statistics. * However this requires to apply an absolute value first. How do we do? * [Single subject] Unconstrained sources: How do compare two conditions with multiple trials? * Norm(A)-Norm(B): Cannot detect correctly the differences * (A-B): We test individually each orientation, which doesn't make much sense. * We would need a test for the three orientations at once. * [Group analysis] Rectify source maps? * Recommended in Dimitrios' guidelines, which is incoherent with the rest of the page. <)>> <> <>