Group (Level 2) fMRI Data Analysis - Lab 4 (Level 2) fMRI Data Analysis - Lab 4 Index Goals of this...

23
Group (Level 2) fMRI Data Analysis - Lab 4 Index Goals of this Lab Before Getting Started The Chosen Ten Checking Data Quality Create a Mean Anatomical of the Group Group Analysis: One-Sample T-Test Examine Results in SPM Visualization of Results in MRIcron Region of Interest Analyses Non-parametric model estimation Goals of this lab 1. Learn how to evaluate aspects of data quality that affect group analyses. 2. Learn how to run group analyses on the 10 subjects included in the course dataset. 3. Learn how to correct your results for multiple comparisons at both the voxel and cluster levels. 4. Learn how to visualize and explore your results. 5. Learn how to define regions of interest (ROI) and use them in a group analysis. Before Getting Started Today's lab will require use of several 3rd-party extensions to spm12 analysis in MATLAB. These are available in a folder called extensions that should be present in the folder containing the data for your 10 subjects. Before you get started, add that folder - along with all of its subfolders - to your MATLAB search path. Once you are finished, check to make sure it worked by running the following in the MATLAB command window (for each MATLAB should print the path to the file - if not, try adding the path again): which spm which files which peak_nii which nee_ROI

Transcript of Group (Level 2) fMRI Data Analysis - Lab 4 (Level 2) fMRI Data Analysis - Lab 4 Index Goals of this...

Group (Level 2) fMRI Data Analysis - Lab 4Index

Goals of this LabBefore Getting StartedThe Chosen TenChecking Data QualityCreate a Mean Anatomical of the GroupGroup Analysis: One-Sample T-TestExamine Results in SPMVisualization of Results in MRIcronRegion of Interest AnalysesNon-parametric model estimation

Goals of this lab1. Learn how to evaluate aspects of data quality that affect group analyses.2. Learn how to run group analyses on the 10 subjects included in the course dataset.3. Learn how to correct your results for multiple comparisons at both the voxel and cluster

levels.4. Learn how to visualize and explore your results.5. Learn how to define regions of interest (ROI) and use them in a group analysis.

Before Getting StartedToday's lab will require use of several 3rd-party extensions to spm12 analysis in MATLAB. Theseare available in a folder called extensions that should be present in the folder containing the datafor your 10 subjects. Before you get started, add that folder - along with all of its subfolders - toyour MATLAB search path. Once you are finished, check to make sure it worked by running thefollowing in the MATLAB command window (for each MATLAB should print the path to the file - ifnot, try adding the path again):

which spm which files which peak_nii which nee_ROI

The Chosen TenBy now you will have estimated (at least) two distinct models of the fMRI timeseries for the subjectyou just happened to choose to examine during the first SPM lab on preprocessing. Now, brieflyclose your eyes and imagine that, magically, the same models were estimated for the remainingnine subjects in the dataset. Now, open your eyes and behold the precooked folder containing anormalized anatomical image (wanat_hires.nii) and folders for the two models estimated in thesingle-subject lab.

IMPORTANT: Use the precooked folders to estimate your group level analyses for EVERYsubject, including the one you've already done some processing on. This will ensure thateveryone is starting with the same set of data.

Checking Data QualityThere are at at least two questions you need to answer about your individual subject data beforeyou begin a group analysis:

Is everyone in the same stereotaxic space? Use check reg in SPM to verify that all 10 sets of images are in the atlas space. Before you dothat, note that for this lab there will be many instances in which you will have to select a set of 10images from each one of The Chosen Ten. To learn how to DRAMATICALLY speed up theprocess of selecting multiple files, read this tutorial before moving on. (Seriously, it's mandatory.)Once you're ready, examine 10 wanat_hires.nii's and see how the anatomy lines up (if theorthogonal viewers are too small, view the first 5 and then the second 5 images). Are there anysubjects who seem out of registration with the others?

Is anyone missing functional data? For this, use check reg to compare the 10 "mask.img" file located in your single subject analysisfolders. (Do this just for the 2x2 model, but know that it is generally good practice to do this for

every model that you estimate.) SPM automatically generates these images to show the User(that's you!) which voxels were included in their analysis. This is called masking, in which only asubset of all voxels in the image are singled out for computation. When SPM decides whichvoxels to include and which to exclude (which it does by default), the masking is known as"implicit" since it happens without the User having to "explicitly" specify a mask. You can learnmore about "implicit" versus "explicit" masking in the SPM manual, or here. This is very importantto know, for the following reason: By default, SPM will only include a voxel in your group analysisif and only if EVERY individual subject has data at that voxel. If 9/10 have it, it will be excluded.With that in mind, check out your group's mask images, playing close attention to ventral regionsof the frontal and temporal lobe that are notoriously susceptible to signal distortion and signalloss. Are there any subjects who seem to have more signal loss than others?

Create a Mean Anatomical for the GroupLet's create an anatomical reference image using the ImCalc tool:

1. Go to Options: Data Matrix. Click Yes-read images into data matrix. This will allow ImCalc toread all of the images you are about to specify into matrix X.

2. Now go to Input Images and select the 10 wanat_hires.nii which are subjects' normalizedanatomical images.

3. In Output Filename type wanat_hires_mean.img. In Output Directory specify the directoryinto which you want the mean anatomical to be written. In Expression write mean(X). Thisexpression will create an average of the anatomical images.

4. Run the batch.5. Use the Check Reg utility to compare the mean anatomical to the template image.

Does it look like the group is, on average, in good registration with the template? Now take a quick look at this tutorial to see how to do what you just did in less than 10 secondsusing the function FILES and a second function you'll learn about called BSPM_IMCALC.

Group Analysis: One-Sample T-TestStart by making an output folder for each of the analyses you plan on running. If I were you, I'dmake a folder called "groupstats" in your data directory (use "mkdir groupstats" in the MATLABcommand window to do this). Then, enter that folder with "cd groupstats" and make two additionalfolders called "2x2" and "Parametric". Finally, enter the 2x2 folder with "cd 2x2" and make folders

called "Why-How" and "Face-Hand". These correspond to con_0001.img and con_0002.img inyour individual subject folders (you'll use the precooked models, even for your own subject). Now,let's use the Batch Editor to specify and estimate a one-sample t-test on the first of these images:

1. Open the Batch Editor

2. Open a Stats: Factorial Design Specification module

3. For Directory, select the analysis directory you created (i.e., the Why-How directory).4. Click on "Design" and observe that you can select from a variety of statistical models; the

one we need, "One Sample t test", is already selected. Expand it, then for Scans, select theten (10) con_0001 contrast images. Tip: use the files command to create a list of all contrastimages that you can copy and paste into the 'Scans' dialog when you click edit:

5. Add an Estimation job using the Batch Editor (as we did on Monday). Specify a dependencywith the SPM.mat created from the first job.

6. Add a Contrast Manager job. Define two contrasts. First, "Why-How" requires a singlecontrast weight: +1. Then, "How-Why" requires the inverse: -1.

7. Save this Job.

8. Repeat the above for the Face-Hand contrast.9. Save that job, too.

10. Load both jobs using "Load" from the Batch Editor menubar. The Module List should looklike this:

11. When you're ready, run the jobs. The SPM figure window should look like this:

Examine Results in SPMThe time has come to peer inside the group mind of The Chosen Ten. Using the Results button inthe SPM menu, load in the SPM.mat file for the 2x2 model and select the Why > How contrast forviewing. For now, threshold it with:

1. Do not apply masking.2. P-value adjusment should be "none"3. Threshold should be left at .0014. Extent threshold at 0

Once you see the "glass brain", use the overlay menu (using 'sections') to use the meananatomical as an underlay for the thresholded statistical map.

Use the "whole brain" option under p-values to produce a report showing the peaks wihtin eachidentified cluster of activity. Below, you can see this table. The circled part at the bottom (FWEc)shows the minimum extent (which we've so far been leaving at 0) required for a cluster toconsidered "significant" at a family-wise error rate of .05. This is one of the forms of cluster-levelcorrection for multiple comparisons that SPM offers.

To apply this correction, use the drop down menu to change the thresholding you're using, asshown below:

Enter all the same values except the last one, where it asks for the "extent threshold". Instead ofentering "0", enter the value necessary for cluster-level correction. Does the resulting thresholdingstatistic map look less noisy to you?

Now, let's change the threshold again but this time apply a voxel level correction for multiplecomparisons. To do this, use the change threshold procedure as above. When you get "P-valueadjusment", choose the option for family-wise error (FWE). Then, stick with the default thresholdof .05 (which in this case refers to the FWE corrected threshold), and do not apply an extentthreshold (that is, leave the last input at 0). Did this change the number of "supra" thresholdvoxels?

At this point, this walkthrough challenges you to do the following:

1. Use SPM to load the results for the Face > Hand contrast.2. Save a CSV file that reports those regions that survive an uncorrected voxel-wise threshold

of .001 and a family-wise error corrected cluster-level threshold of .05.

Which regions survived? If you did things correctly, you should see bilateral activation in some no-name region of the brain that no one has every heard of. (Just in case it wasn't clear, that lastsentence was meant to be ironic.) As shown below, SPM offers a number of different options forsaving all or part of your results as image files. Given that we'll shortly be discussing region ofinterest analyses (ROIs), use the "Save current cluster" option shown below to save an image ofjust the right amygdala (for this, you'll need to have the crosshair positioned on a voxel in the

cluster).

Use the Display utility to take a look at the "functional" ROI you've just created:

Visualization of Results in MRIcronTo visualize the data, we'll use MRICron. MRIcron has already been installed on your machineand can be found here. You can launch MRIcron from Windows by doube-clicking the mricronicon. Once it is open, click on Open Templates and load in the chi2better.nii.gz. This is a skull-stripped version of a canonical template in MNI space.

Next, click on Overlay -> Add and open the spm_T map located in your group analysis of the Why> How contrast in the 2x2 model.

Once loaded, we can change the color map and the upper and lower bounds of the color map:

Let's start with the "Multislice" feature. Go to Window -> Multislice

Under View, you can change which slices you want to look at (Slices...), how much the slicesvisually overlap (Overslice), and various other features. When you’re happy with the figure, youcan go to File -> Save as bitmap... to cherish forever.

Not satisfied? Try the Window -> Render option that is much more flexible than SPM:

The Azimuth and Elevation change the view. Make sure to check the option Overlay -> Search ->Infront/below BG surface so that deep activations are not mysteriously brought to the surface. You

can control how much activations are brought to the surface under Overlay -> Search Depth.

Finally, we can peel back chunks of the brain to observe activations lurking in inner structures.Click on View -> Cutout and then click the Show cutout checkbox.

The lower and upper limits of X, Y, and Z will determine what parts of the brain are cutout. Feelfree to play with those values and perform different cuts. Brain surgery made simple...

When you’re satisfied with your cuts, you can click “OK” in the cutout window. Finally, click the

double red arrow at the top of the render window to generate a high resolution rendering. Note,that doing this multiple times may cause MRIcron to crash. It appears to be good for one highresolution rendering per use of the program. Now, you can click on File -> Save as bitmap... for anice figure.

Region of Interest AnalysesYou've already seen above how you can easily make functional ROIs from activation maps inSPM. In this tutorial, you'll see how to make ROIs based on the peak coordinates reported inprevious neuroimaging studies.

Finally, let’s extract data from ROIs. First, gather the contrast images for the Face > Handcontrast. You can use the function files again, or you can find them neatly stored in the GroupLevel SPM.mat file under the field “SPM.xY.P.” Next, we’ll extract ROI averaged data for eachsubject.

P = SPM.xY.P; % alternatively, set P to the images you gathered using files

ROI = 'ROI_Sphere9_-50_9_30_L_IFG.nii'; % Or you can use a different ROI file

roiData = nee_ROI(P,ROI);

roiData

This returns an n x 1 vector with the contrast estimate averaged across the ROI for each subject.You can perform a t-test on it:

[h,p,ci,stats] = ttest(roiData)

Next, you can do the same analysis on the functional ROI you created above. That analysis

should be highly significant. But we already knew that since the functional ROI was defined as aregion that showed a significant effect (and reporting it as if it were another independent test in apaper is one form of double-dipping). However, extracting data from a functional ROI cansometimes be useful to serve as a correlate (e.g. with behavior or another ROI).

Non-parametric model estimation (SnPM)With the Statistical nonParametric Mapping (SnPM) toolbox you can estimate your models using anon-parametric permutation-based approach. Non-parametric model estimation has theadvantage that it does not have any assumptions about the distribution of your outcome measure(i.e., your voxel values) and is therefore also appropriate for non-normally distributed residuals.

You can start the SnPM toolbox by typing snpm_ui, or by selecting a design from the batcheditor:

In the sample below we will run the same one-sample t-test as we ran previously, but now usingSnPM. For this, create a new folder to store your model and results. Next, select MultiSub: OneSample T test on diffs/contrasts. Specify your analysis directory, and the contrast images of thecontrast you want to analyze:

You can select your first level parametric contrast images for this second level non-parametricgroup level analysis. For this example, we will select each second contrast image (Face-Hand) ofthe parametric 1st level analysis of all 10 subjects (i.e, con_0002.img). SnPM has a couple ofoptions that you have to set. As you know by now, SPM (and SnPM as well) provide a lot of goodinformation about the options in the batch editor in the bottom part of the batch editor. Below, wewill briefly go over the most important options. For more information see the text boxes in theSnPM batch window:

Number of permutations: The number of permutations that is being conducted can be exhaustive, but this normallytakes a very long time to complete. This is why you can select to run a random subset of thepossible permutations. The default is 5000. You can reduce the number of permutations for

testing. Generally, for publication you should set the number of permutations to 10,000 ormore. The more permutations, the more precise the p-value. For now, let's set the numberof permutations to: 1000. (Note that for a one-sample t-test the non-parametric sign flip testis used instead of permutation tests).Variance smoothing: This is particularly useful if you have a small sample (i.e., n<20). In this case SnPMregularizes your variance image. In general, the smoothing kernel that you select for yourvariance maps should not exceed the smoothing kernel that you selected for your data (i.e.,8mm in our case). For now, let's set the variance smoothing to: [8 8 8]. Additionalbackground information about variance smoothing by Thomas Nichols can be found HERE.Cluster inference: By default cluster inference is not performed because it takes a long time to run. If you wantto easily switch between different cluster size inferences it is recommended to set clusterinference to: Yes (slow, may create huge SnPM_ST.mat file). However, for now we are goingto use cluster inference with a predefined statistical threshold. For this, select Yes, setcluster-forming threshold now (fast) and set it to 0.001

Now that we have created a model, we are going to add add compute to our batch (this is theequivalent of estimate in the parametric analysis). To add compute to your batch select it from thebatch menu: SPM --> Tools --> SnPM --> Compute. Click on dependency and select the designthat you just created.

Finally, add inference to your batch by selecting it from the batch menu: SPM --> Tools --> SnPM--> Inference. Inference is the equivalent for results in SPM. Set the SnPM.mat results file todependency and select: Compute: SnPM.mat results file. For type of thresholding you can selecteither voxel wise or cluster wise inference. Both are valid options, but for now we are going toselect Cluster-Level Inference. We will leave the Cluster-Forming Threshold at NaN, becausewe have already set it to p<0.001 when we were defining our model.

Now, keep the default value for all other options, save your batch, and run it!

Results: Your results overview should look like this (click to enlarge):

If you still have time, compare these results to the results from the parametric One-Sample T-Testof the second contrast (Face-Hand). Do they differ a lot? If so, what could be an explanation?Note that SnPM does not offer all the tools in the results window that SPM offers. However, SnPMstores the pseudo-T image in the file "snpmT-.img". You can open this file in MRICron and use theT-threshold that you will find in your SnPM output, under "Cluster-defining thresh".