Download presentation
Presentation is loading. Please wait.
Published byKristian Ross Modified over 9 years ago
1
SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May 9 2007
2
Start matlab and initiate SPM by running spm fmri from the command prompt
3
The first thing we will do is look at our data by clicking on the Display button.
4
Navigate to the first session in your sample data set and select the f.nii file. Then click done
5
Click around in the brain views. The crosshairs will move to where you click
6
Save this picture as a JPEG under the sample_data directory Then display and save the other two sessions as well
7
Now we will begin to preprocess the data and prepare it for statistics Click on the Slice Timing button
8
On the right you will see this in the SPM graphics window. Double click on the slice timing node to expand it
9
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.
10
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.
11
Single click on the first session. Then in the top right panel single click on Specify Files
12
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
13
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
14
Enter these values for the next four nodes… TR 2, repetition time TA 1.93939, acquisition time is usually TR-(TR/nslices) Slice order 1:33, a vector 1,2,3,…33 Reference Slice 16, a slice in the middle of the brain When you are done click the save button to save your settings…
15
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
16
Next we will realign our data Realignment corrects for movement over time using affine registration Click the Realign dropdown and select Realign
17
Click on New “Realign: Estimate & Reslice” to create a new realignment node. Double click on the new node to expand it
18
Double click on all the nodes to expand them
19
Enter these values for the estimation options… Quality 0.5, 0<quality<1,where 1 is the highest quality Separation 4, default Smoothing 5, default Num Passes Register to first (images will be aligned with the first image in the series) Interpolation 2 nd Degree B-Spline, default Wrapping No wrap, default Weighting , default
20
Enter these values for the reslice options… Resliced Images Mean Image Only Interpolation 4 th Degree B-Spline, default Wrapping No Wrap, default Masking Mask Images, default
21
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
22
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
23
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
24
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
25
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
26
Rotational movement parameters resemble that of airplane terminology
27
Now we will normalize our data to the standard template Click on the Normalize button
28
Click on “Normalise: Estimate & Write” Expand all your nodes
29
For the Data node add 3 New “Subject” Items Each of these will be for sessions 1,2 and 3 respectively
30
For each subject node expand it and enter these parameters… Source Image meanaf.nii, average of all the volumes produced during realignment Source Weighting , default Images to Write all 195 volumes of the realigned af.nii file and the meanaf.nii file
31
Under the Estimation node, click template image, then specify files. We will use the EPI template included in the spm5 package.
32
Set the following estimation options to these values… Template Weighting Image , default Source Image Smoothing 8, default Template Image Smoothing 0, default Affine Image Regularisation ICBM space template, default Nonlinear Frequency Cutoff 45 Nonlinear Iterations 16, default Nonlinear Regularisation 1, default
33
Set the following writing options to these values… Preserve Preserve Concentrations, default Bounding Box leave as default Voxel Sizes [2 2 2], default Interpolation Trilinear, default Wrapping No wrap, default Save your settings in your file type of choice under your sample_data folder. Then Run the analysis.
34
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
35
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
36
Now we will spatially smooth our data Click on the Smooth button
37
Select all your waf.nii images from the 3 sessions Set FWHM to [8 8 8] for an 8mm Gaussian smoothing kernel
38
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
39
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.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.