FSL analysis of a block design
  Introduction

This page describes how to analyze fMRI data from a single individual using FSL. FSL is a powerful and free tool to measure task-related changes in the brain's blood flow. To complete this tutorial you will need:

  • To conduct FSL single subject data processing you will need
    1. FSL installed on your computer.
    2. The workshop CD includes a sample dataset - located in the 'data' folder (/home/user/data/), or you can download this the data . This includes a 120 volume fMRI session (e.g. fds.img), a text file (left_onsets2dum.txt; right_onsets2dum.txt) that describes the events that occurred during the fMRI session, a T1-weighted anatomical scan (ads.img), as well as a skull stripped version of this image (bads.img).
  • About the sample dataset

    This was a simple finger tapping task. For periods of 11.2 seconds, the screen rapidly flashed with an arrow (<,> or ^). When the arrow pointed up (^) the participant was asked to rest, when it pointed right (>) they were intstructed to tap their right index finger, and when it pointed left (<) they were requested to push their left index finger. These blocks repeated for the whole scanning session (120 volumes, about 6 minutes). The order of the blocks was randomized, but the task always changed every 11.2 seconds (e.g. a left block was always followed by either a right or rest block). The first 2 fMRI scans will be discarded (as these appear brighter as the T1 effects are not saturated). The onsets of the tasks are recorded in the files left_onsets2dum and right_onsets2dum.  first finger task began 11.3 seconds after the first saved fMRI dataset. The image below shows the three event types (left, right or up arrow) as marks at the top of the image (with blue, red and green indicating the stimuli types). The colored lines show the expected HRF response. Note this figure is for illustration only - the actual block order was a bit different.
    Task Design

    FSL single subject data processing

    Steps for functional MRI analysis using FSL version 3.2 running under Windows XP

    1. Start FSL by clicking on the fsl shortcut within the computer desktop, or by starting typing 'fsl' from the command prompt (or from the CygWin command prompt if you are running Wndows). Note that if you type 'fsl &', the command console under which FSL is running will not be "frozen" by FSL, but can be used for other commands.
    2. By typing fsl, a user interface (the one with a fossil fish on its top) appears. This interface contains several options, but the one to be used now for fmri is 'FEAT FMRI Analysis' button. Press the corresponding button and this will open the Feat interface.(The forthcoming steps are described for use in FEAT version 5.43)
    3. The feat interface has two top buttons. The following analysis is a first level analysis (within one single subject), and it is a full analysis (involving preprocessing of the data, the statistical spinnings of fmri analsysi and post-stats registrations).
    4. The FEAT interface five tabs across the top portion of the screen, oriented in a horizontal line. The fmri analysis can be set by defining the parameters within each one of those buttons, in a left to right order:
      • within Misc Tab: - leave 'Featwatcher' checked to gauge the progress of the fmri analysis. - set the delay to start the analysis to a number different to zero: we want to compute this analysis immediately.
      • within Data Tab: - Number of analysis is set to one. - Press select 4D data. Browse to the folder in which the 4D data file is stored and select the .hdr of the corresponding file (e.g. \home\user\data\fds.img) *See footnote. After selecting the 4D file, the number of volumes will automatically be displayed. In our case 120. - enter the TR. In our case 3.0. - set the delete volumes to 2 - set the high pass filter cutoff to 100 s. (for block-designs such as ours this could be set as low as four times the block duration: 44.8 s in our case)- You can set the output directory: you must be able to write to this file (the output directory can not be your DVD drive). If you leave it blank, it will write the results in the same folder where the 4D data is. FEAT write the results in a folder called "4Ddataname.feat". In our case fds.feat. If you re-run the analysis, it will create a second folder called fds+.feat, and so on.
        FSL DATA TAB
      • within Pre-stats: - Slice timing correction could be set to regular up (0,1,2...n-1) [STC has little influence on block designs]. - Motion correction is done with Motion Correction using FMRIB's Linear Image Registration Tool - MCFLIRT. - Keep Brain Extraction checked. - Spatial smoothing FWHM set to 8mm (between x2-x3 the raw resolution of the functional imaging). - Lets keep Intensity Normalization (equivalent to Grand Mean Scaling) unchecked. - Temporal filtering Highpass checked.
      • Within Stats Tab - Simple model setup could be used for alternating designs like ABAB, or ABCABC. Our block design is a bit more intricate so press the 'Full Model Setup' button (this can also be used for event related designs). - Clicking full model setup opens a General Linear model interface. Within this interface, follow the steps: - The number of original EV (original EVS - explanatory variables, or simply put: conditions) is set to 2, because we are interested in the motor actication of the "left" and "right" conditions. - Each EV is setup separately. - The basic shape of the wave form that describes the stimulus that we wish to model is defined by a custom file expliciting the time in seconds of the onset of the stimulus, how much time (also in seconds) the stimulus last, and the value of the input. This requires a .txt file containing a matrix under which the columns are the variables stated above (i.e., first one time of onset, second one the duration, and the thrid one the value) and the rows represent the stimuli
        Contents of left_onsets2dum.txt
        29.2    11.2    1
        62.8    11.2    1
        85.2    11.2    1
        118.8    11.2    1
        163.6    11.2    1
        197.2    11.2    1
        253.2    11.2    1
        275.6    11.2    1
        320.4    11.2    1
        342.8    11.2    1
        Contents of right_onsets2dum.txt
        18    11.2    1
        51.6    11.2    1
        96.4    11.2    1
        141.2    11.2    1
        186    11.2    1
        219.6    11.2    1
        242    11.2    1
        264.4    11.2    1
        298    11.2    1
        331.6    11.2    1
      • Setting Up Conditions: This is set as follows: initialls set the number of original EVs to the number of condictions (two). For each condition, do the following: first choose the 'Custom (3 column format)' from the 'Basic Shape' pull-down menu, second browse to find the file left_onsets2dum.txt (for the first condition) and  left_onsets2dum.txt (for the second condition) *See Footnote, third set the convolution (which is the form of the Hemodynamic response function that will be applied to the basic waveform) to 'Gamma', fourth maintain Phase, Stddev and Mean Lag as defaults (respectively 0,3 and 6 secs), fifth apply temporal filtering. As we are using a block design, I suggest making sure  temporal derivative is unchecked, for event related designs you may want to have this checked.

      • Setting Up contrasts: Once these parameters have been entered click on 'Contrasts & F-tests' tab. Since we are intersted in the effects of activation of only two conditions, lets create 5 statistical contrasts (all will be t-tests). Lets specify our conditions

        1. OC1: Find what is active for left motor presses: title= left>, EV1= 1, EV2= 0
        2. OC2: Find regions more active for left than right motor: title= left>right, EV1= 1, EV2= -1
        3. OC3: Find what is active for right motor presses: title= right>, EV1= 0, EV2= 1
        4. OC4: Find regions more active for right than left motor: title= left>right, EV1= -1, EV2= 1
        5. OC5: Find regions more active for any motor activity title= motor>rest, EV1= 1, EV2= 1
      •  Press Done to continue.
        FSL STATISTICS

      • Within Post_stats Tab- Do not use a pre-threshold masking - Maintain defaults for thresholding (Cluster analysis, Z threshold of 2,3, cluster P of 0.05) - Maintain defaults for rendering and contrast masking.
      • Within Registration Tab: check the 'Main structural image' checkbox and insert the correct filename (e.g. C:\cygwin\block\ds\bads.img). Note: FLIRT works much better if you scalp strip your anatomical scans prior to registration. The sample image has been scalp-stripped using the outstanding BET tool included with FSL. Make sure the normalization to standard space uses 12 DOF (12 parameters: rotation, zoom, shear, translation in 3 dimensions). *See Footnote,.
        REGISTRATION
    5. Press the 'Go' button on the bottom left. and Featwatcher will be opened and will show you the progress of the analysis. After the analysis finishes, Feat watcher will bring you a message stating the time it finished and where the folder with the results is.
    6. Look for the folder called fds.feat that will probably be in the same folder where the 4D data is.
    7. To assess the analysis click on report.html and the internet browser used as the default in your computer will bring the page containing
      • Click the link to view the motion correction report
      • Click the Thresholded activation images: you are redirected to a link containing the cluster list with the corresponding local maxima eiher in voxel space version or in Talairach space version.
      • The time series plot for the whole experiment
      • A summary of the analysis methods and its referencese) the design and covariance matrices

    * Footnote: FSL 3.1/3.2 working under Windows has an annoying bug, which is to duplicate the name of the path. If you want it to be C:/sensefsl/fHAM26S.hdr it will automatically write C:/sensefsl/C:/sensefsl/fHAM26S.hdr To overcome this problem, just delete the unwanted part.

    23 October 2005: Leonardo Bonilha and Chris Rorden

    logo