Basic FEAT lab
From NITP Summer Course Wiki
Contents |
Basic Single Subject Block Design Analysis with FEAT
Adapted from: FEAT Practical from FSL
FEAT Tutorial
This tutorial leads you through some standard single-subject analyses with FEAT.
Launch the FSL environment, by double-clicking the Launch NITP Environment file located on the Dock, next to the trash icon.
Example real audio-visual dataset
We will be using data from the av directory inside the fsl_course_data/fmri directory.
The dataset fmri.nii.gz is from an audio-visual experiment. Auditory stimulation was applied as an alternating ``boxcar with 45s-on-45s-off and visual stimulation was applied as an alternating ``boxcar with 30s-on-30s-off. The TR is 3 seconds. We have extracted just 45 timepoints and 5 slices from the original 4D data, to speed up the analysis.
- Select the Feat application from the main FSL window.
- Press Select 4D data and select fmri.nii.gz (don't just type "fmri.nii.gz" in the file select popup or you probably won't end up setting the full pathname; use the file-select icon on the right to select the input data). This file is located under:
fsl_course_data/fmri/av/fmri.nii.gz
- You may see a warning dialog, which is fine.
- FEAT now knows how many time points (volumes) you have (45 in this cut-down dataset). If your TR (time between 3D volumes) is not 3s, change it (it is right for this dataset).
- Set the High pass filter cutoff to 90. It is best to set this to the maximum stimulation period (in this case 45*2=90secs); the highpass filter used in FEAT has quite a slow roll-off above the cutoff frequency, so setting this to the 90s period time is fine.
- Select the Stats tab and press Full model setup to setup the GLM details.
- Change the Number of EVs to 2 (we have two conditions to model separately - audio and visual).
- Setup EV1 (the visual stimulation timing): set Off to 30, On to 30 and Phase to 30. This describes a square wave of total period 60s. It starts with an ON period, hence the phase setting, which shifts the waveform forward in time. Add a label to describe this variable.
- Setup EV2 (the auditory stimulation timing): set Off to 45, On to 45 and Phase to 45. This describes a square wave of total period 90s. Label this variable as well.
- Now setup the Contrasts. Set the Number of contrasts to 2, set the first (OC1) to [1 0] and the second (OC2) to [0 1]. Thus the first output colour overlay image produced will show visual activation as only EV1 is used, and the second will show only auditory activation. Note that you can give each contrast a title. So, entitle the contrasts "Visual" and "Auditory" accordingly.
- Now setup the F-tests. Set the Number of F-tests to 1. Select both contrasts (both buttons turn yellow). Thus the third output colour overlay image produced will show where either visual or auditory activation occurs (i.e. will show both on a single image).
- Press View design. Make sure you understand the resulting design matrix. Time goes down the page, with every 10 TRs ticked off on the left. The red bar shows the width of the highpass filter (any signal much longer than it will get removed). There are 4 columns in the design (1 and 3 are the ones you just set up and 2 and 4 are temporal derivatives of 1 and 3 - this will be explained in a later talk). The contrasts appear at the bottom of the image, with the F-test to the right of the contrasts. Note, that you can make the design matrix display disappear just by clicking on it once. For now, leave the design matrix display up (Press View design again if necessary).
- Now, return to the EVs tab and FOR BOTH EVs change Convolution from Gamma to None and deselect Apply temporal filtering and deselect Add temporal derivative.
- Press View design and note how you are now viewing the underlying conditions that were entered.
- Restore the original settings one step at a time FOR BOTH EVs, viewing the design after each change (change Convolution to Gamma, then select Apply temporal filtering, then select Add temporal derivative). Make sure you understand the changes in the design matrix and their importance.
- When you are happy that the design matrix is restored, press Done.
- Press the Pre-stats tab to look at the preprocessing steps. Make sure BET brain extraction is deselected, as we only have a few slices of data. All the other default pre-processing steps are fine for this dataset. Also look at the Post-stats section - again the defaults are fine; cluster-based thresholding will be carried out.
- Select the Registration tab. By default FEAT will register the middle timepoint image (saved as example_func in the .feat output directory) from the 4D FMRI input data directly to the standard space template. We recommend in general turning on the Main structural image option so that the lowres FMRI image is first registered to a brain-extracted highres structural image from the same subject; this highres is then registered to the standard space template, and then the two registrations are combined to give an example_func2standard.mat transform which will be used later to resample the FMRI stats into standard space. If the 4D data here only contains a few slices, then even before registration to the highres image, it is a good idea to register example_func to a whole-head EPI image which contains basically the same slices as the 4D data.
- Select Initial structural image, set the file to epiwholehead.nii.gz and set the DOF to 3 (as we only have a few slices in the timeseries data which correspond to certain slices in the epiwholehead image, we do not want to allow the image to be rotated). Set the Main structural image file to structural_brain.nii.gz with 7 DOF (note that we have already run BET on this, and have reduced the resolution of the structural image to save time on the highres to standard registration). Leave Standard image turned on with avg152T1_brain.nii.gz selected and set the DOF to 12.
- You are now ready to run FEAT. Press Go. A browser window should open showing you status updates as the analysis runs. FSL will continue to process the data in the background, even if you close the window. FEAT will take 5-10 minutes to complete.
- While FEAT is running, run fslview to have a quick look at the different images mentioned above: start with epiwholehead.nii.gz. Launch fslview from the main FSL window, and once fslview had loaded, choose the open command and navigate to this file under the fsl_course_data/av/ folder as we did originally in FEAT.
Afterwards, exit this and view structural_brain.nii.gz and finally exit this and view fmri.nii.gz. Note that when viewing the 4D image you can see the image time series as a movie by pressing on the movie icon, and you can also see time series plots by pressing View->Timeseries.
- Again; while FEAT is still running, we will now use FSLView to create a hand-drawn mask in standard space that will be used later to find out about activation statistics from within the mask. Choose an area of interest - for example, visual cortex.
- Load the standard space template image: fsl/etc/standard/avg152T1 into FSLView
- Create an editable mask image with the same dimensions as the standard space template, by clicking on avg152T1 in the image list (in the bottom right) and then pressing File -> Create Mask.
- Move the cursor around until you are in the middle of the visual cortex around about slice number z=33. Turn on "drawing mode" by pressing the button with the pencil icon. Increase the pencil drawing width by increasing the value in the right-hand textbox underneath the pencil button, for example, to 10. Click and drag over a region of the brain roughly corresponding to the visual cortex, in the axial view. Whenever you let go of the mouse button the region you have been drawing will get filled in on the mask overlay image. You can move up to the next slice using the up arrow next to the Z co-ordinate box, and do that one as well.
- When you have drawn the mask in a few slices, save the mask image to file, by making sure the mask is selected in the image list, and then pressing File -> Save. Choose a filename, for example, vismask.nii.gz in your ~/fsl_course_data/fmri/av directory. Save.
- When FEAT has finished, the webpage will stop updating. Look carefully at the various elements of the page, including motion correction plots, colour-rendered activation and registration results. Note that if you click on the activation images you get a table of cluster co-ordinates.
Re-thresholding
You can re-run thresholding on the FEAT run that you have just created very easily.
- Start the Feat GUI. Change Full analysis to Post-stats. Select the Data tab and press Select FEAT directory and select fmri.feat. A standard warning should pop-up informing you that the information in that FEAT directory will have been loaded in. Go to Post-stats and try a different thresholding option - maybe try voxel-based thresholding with the same P threshold as before (0.05).
- Select the Registration tab and deselect all registrations so that none occur, as there is no need to repeat them.
- Select the Misc tab and change Overwrite original post-stats results to Copy original FEAT directory for new Post-stats/Registration, as we want to be able to compare the new results to the old.
- Then press Go. A new FEAT directory will get created (fmri+.feat); compare these results to the original run.
- If you get time at the end of this session try running a range of threshold types and settings to see their effect. You could also try changing the preprocessing options - for example, how much worse is the activation if you do not run motion correction?
High-resolution Single-Session Overlays
You might want to see your low resolution data overlaid onto your high resolution image. Use the Renderhighres gui and select your FEAT output directory. Launch the program by typing the program name (Renderhighres_gui) into the command prompt of the Terminal window. Select the Space to upsample to: standard option and also select the Background image: main structural option. When the processing has finished you can find the hr/rendered_*.nii.gz pictures in the FEAT directory and view them with fslview. Renderhighres takes a few minutes to run, as the images get resampled into high resolution using accurate, but slow, sinc interpolation method.
