spm5 tutorial, part 1 fmri preprocessing tiffany elliott may 9 2007

39
SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

Upload: kristian-ross

Post on 16-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

SPM5 Tutorial, Part 1fMRI preprocessing

Tiffany Elliott

May 9 2007

Page 2: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

Start matlab and initiate SPM by running spm fmri from the command prompt

Page 3: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•The first thing we will do is look at our data by clicking on the Display button.

Page 4: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Navigate to the first session in your sample data set and select the f.nii file.

•Then click done

Page 5: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Click around in the brain views. The crosshairs will move to where you click

Page 6: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Save this picture as a JPEG under the sample_data directory

•Then display and save the other two sessions as well

Page 7: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Now we will begin to preprocess the data and prepare it for statistics

•Click on the Slice Timing button

Page 8: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•On the right you will see this in the SPM graphics window.

•Double click on the slice timing node to expand it

Page 9: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

In the panel to the left is a list of the jobs you have currently selected. It is organized in a tree structure. Double-clicking a node will allow you to expand and contract its

items.

+ means the node is contracted-means the node is expanded

Items with an X to the right have not been set.

To the right is an example of our expanded slice timing node.

Page 10: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

In top right panel are the options available for a highlighted item. Once you have

single clicked on the item of your choice the options will appear.

Single clicking on New “Session” will create a new item to associate data with.

We will do this 3 times for 3 runs of the visual oddball task giving us 3 session to

select data for.

Page 11: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

• Single click on the first session.

• Then in the top right panel single click on Specify Files

Page 12: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•The first thing you want to do is make sure you set the range of frames to 1:195. This is because we are working with 4D image files and we want all volumes in the file to be included. In this particular paradigm there are 195 volumes. Hit enter after you type in this number.

•Then navigate to your sample data and click on the Rec button to recursively select your nifti volumes

•Click Done and follow the same steps to select your data for sessions 2 and 3

Page 13: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Click on the Number of Slices node and then Specify Text

•Enter 33 into the prompt box and hit enter

•You will see your input in the middle right box

Page 14: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

Enter these values for the next four nodes…

TR 2, repetition timeTA 1.93939, acquisition time is usually TR-(TR/nslices)Slice order 1:33, a vector 1,2,3,…33Reference Slice 16, a slice in the middle of the brain

When you are done click the save button to save your settings…

Page 15: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•You can save as mat file, m file (script), or xml file. Pick your favorite format, name the file, and save under the sample_data folder•After you have saved your settings click Run to perform the slice time correction

Page 16: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Next we will realign our data

•Realignment corrects for movement over time using affine registration

•Click the Realign dropdown and select Realign

Page 17: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Click on New “Realign: Estimate & Reslice” to create a new realignment node.

•Double click on the new node to expand it

Page 18: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Double click on all the nodes to expand them

Page 19: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

Enter these values for the estimation options…

Quality 0.5, 0<quality<1,where 1 is the highest qualitySeparation 4, defaultSmoothing 5, defaultNum Passes Register to first (images will be aligned with the first image in the series)Interpolation 2nd Degree B-Spline, defaultWrapping No wrap, defaultWeighting <None>, default

Page 20: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

Enter these values for the reslice options…

Resliced Images Mean Image OnlyInterpolation 4th Degree B-Spline, defaultWrapping No Wrap, defaultMasking Mask Images, default

Page 21: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•When you are done entering your items click on the Realign: Estimate & Reslice node•Then click Replicate Item two times making 2 more nodes like the first one•This way we don’t have to re-enter the parameters for the other two sessions

Page 22: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Click on Data and then New “Session” to select your files for each node for realignment. Session 1 goes with the first node. Session 2 goes with the second. Session 3 goes with the third.

•This is done so we can realign each session separately

•If you want to realign all the sessions together, you would instead make 3 sessions under 1 Data node

Page 23: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•We are now working with the slice time correction files from the previous step. So, set your file filter to ^af.*• ^ is a character specifying that the letter that follows must be the first letter in the file name• .* means any number of other characters may follow

Page 24: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Once all your information is entered save the settings in your file format of choice under the sample_data folder.

•Then click Run to perform the Realignment

Page 25: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•As each session finishes SPM will display the results in the graphics window.

•You will see a plot showing how each volume moved with respect to the previous volume.

•Rotational parameters roll, pitch and yaw are in radians

Page 26: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

Rotational movement parameters resemble that of airplane terminology

Page 27: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Now we will normalize our data to the standard template

•Click on the Normalize button

Page 28: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Click on “Normalise: Estimate & Write”

•Expand all your nodes

Page 29: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•For the Data node add 3 New “Subject” Items

•Each of these will be for sessions 1,2 and 3 respectively

Page 30: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

For each subject node expand it and enter these parameters…

Source Image meanaf.nii, average of all the volumes produced during realignmentSource Weighting <None>, defaultImages to Write all 195 volumes of the realigned af.nii file and the meanaf.nii file

Page 31: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Under the Estimation node, click template image, then specify files. •We will use the EPI template included in the spm5 package.

Page 32: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

Set the following estimation options to these values…

Template Weighting Image <None>, defaultSource Image Smoothing 8, defaultTemplate Image Smoothing 0, defaultAffine Image Regularisation ICBM space template, defaultNonlinear Frequency Cutoff 45Nonlinear Iterations 16, defaultNonlinear Regularisation 1, default

Page 33: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

Set the following writing options to these values…

Preserve Preserve Concentrations, defaultBounding Box leave as defaultVoxel Sizes [2 2 2], defaultInterpolation Trilinear, defaultWrapping No wrap, default

Save your settings in your file type of choice under your sample_data folder. Then Run the analysis.

Page 34: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Now we’re going to check our results

•Click on the Check Reg button

•When you are prompted select the wmeanaf.nii image from session 1 and the EPI template that we used from the spm5 package

Page 35: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Click around and see if the normalization did a good job

•Are the results what you would expect?

•Do the edges of different brain regions match up in both images?

•Save this picture as a JPEG under your sample_data directory

Page 36: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Now we will spatially smooth our data

•Click on the Smooth button

Page 37: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•Select all your waf.nii images from the 3 sessions

•Set FWHM to [8 8 8] for an 8mm Gaussian smoothing kernel

Page 38: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

•We will select our normalized images for smoothing

•Set your filter to ^wa.* (normalization puts a w on the front of the image name)

•Smoothing will put an s on the front of the image names

Page 39: SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007

Click Run to perform the smoothing…

Now your images will be ready for modeling!

Friday morning there will be a tutorial on modeling this data.