Setting up FSL
Logging in to Golgi
Go this page for instructions for setting up your Golgi Profile. Checking to make sure that everything is set up correctly will save you much aggravation.
Run “Xwin32” from the Start Menu. An “X” will appear in the icon tray on the taskbar.
Run “F-Secure SSH Client” from the Start menu. In the F-Secure window, select profiles→Golgi. Enter your Golgi password.
Organizing Your Data
In Huxley/Data/Class.01/Students create a folder for yourself. It is helpful to keep open a Windows Explorer window of your Class.01/Students directory we will be working with.
From Huxley/Data/Class.01/Examples COPY, DO NOT CUT!!! ANAT_4 and FUNC_4/Run1_Block and paste them in your folder, renaming them Anat and Func
Create a new folder called FSL in your home directory
Preparing Your Data for Analysis
Note that on Linux/Unix systems, capitalization matters! Make sure that you correctly capitalize directory and file names.
Open a new window in golgi
type cifslogin huxley/data
- type cd /CIFS/Huxley/Data/Class.01/Students/
- Change into your folder (e.g., cd myfoldername) then change into Anat.
- To create the NIFTI files for the anatomical data: <code>bxh2analyze –niftihdr -s -v ANAT4_Coplanar.bxh anat01</code>
- This will make 3 files: anat01.bxh, anat01.hdr, and anat01.img.
- Next, go into the directory with your functional run (e.g., cd ../Func).
- To create the NIFTI files for the functional data: <code>bxh2analyze –niftihdr -s -v FUNC4_V.bxh run1</code>
- This will make 3 files: run1.bxh, run1.hdr, and run1.img
=====Extracting the Brain=====
This removes the surrounding skull and tissue from the anatomical images.
- In Golgi type: fsl &
- This will bring up a GUI, click BET Brain Extraction
- For the input image select the anat01.hdr file.
- Generate image with non-brain matter removed should be the only checked option.
- Click ok.
- This should take about 1 minute to run. When it finishes, you will have a new file in the Anat directory: “anat01_brain.nii.gz”. You should view this file in MATLAB using showsrs2, to see the effects of brain extraction.
=====Help for Problems with FSL=====
Some, but not all, individuals have reported receiving a “DISPLAY is not set…“ error when attempting to start FSL. We are working to diagnose exactly what settings are leading to this error. The following seem to be workarounds:
- Starting a new GOLGI window (keeping your original one open) and loading from that second window.
- Starting FSL from the root directory.
See your TA for help with these, if it doesn't work for you.
====== Running FSL Analyses ======
We'll begin with a first-level analysis (i.e., on only one run of one subject's data).
- Within your FSL folder, create an empty folder named run01.
- Move (don't just copy) the run1.img, run1.bxh, and run1.hdr files you just created into that folder. Also move the anat01_brain.nii.gz file into that folder.
$ mv run1.* ./../FSL/run01
$ cd ../Anat
$ mv anat01_brain.nii.gz ./../FSL/run01
- In golgi, change into the fsl\run01 folder.
- If FSL is not already open, type fsl & and click FEAT FMRI Analysis in the GUI. Just click once; it will take a few seconds to appear.
- Go to this webpage - http://www.fmrib.ox.ac.uk/fsl/feat5/detail.html - and follow along to read about each setting you are changing
===== FSL GUI settings =====
- Pull-down menus
* At top, the left menu should read First-level analysis. The right menu should read Full analysis.
- Misc tab
* Click on this tab. You should leave everything on this tab at the default settings.
- Data tab
* Click on this tab, next.
* Make sure that Number of Analyses is set to 1.
* Click Select 4D Data, go to the run01 folder, and select the run1.hdr file that you created earlier. Click OK twice, ignoring any error messages at this stage.
* Click Select Output Directory, again go to the run01 folder, and click OK.
* Check to make sure your Total volumes is set to 131 (should have changed when you selected your func data)
* Set the TR(s) to 2. This is your repetition time (TR) in seconds.
* You shouldn't have to change anything else. The defaults should be correct: Delete Volumes = 0, High-Pass Filter cutoff (s) = 100.
- Prestats Tab
* Motion correction should be MCFLIRT
* B0 unwrapping should be unchecked (gray)
* Slice timing correction should be Interleaved
* BET brain extraction should be checked (yellow)
* Spatial smoothing should be set to 8mm
* Intensity normalization should be unchecked (gray)
* Temporal filtering should be Highpass
* Melodic ICA should be unchecked (gray).
- Stats Tab
* Use FILM prewhitening should be checked
* Add motion parameterers should be No
* Ignore Full model setup, for now. We'll come back to this in a moment.
- Post-Stats Tab
* The key part of this is Thresholding. From left to right, it should read Cluster, Z Threshold 2.3, and Cluster P threshold 0.05.
- Registration Tab
* Standard space should already be checked, with the file /usr/local/packages/fsl/etc/standard/avg152T1_brain.hdr, Normal Search, and 12 DOF.
* Click the Main structural image checkbox. Select your anat01_brain.nii.gz file and then click OK. You should have Normal Search and 7 DOF selected automatically.
Now leave FSL open, we will come back to it after we set up the design.
===== Setting up your Design =====
This is the part of analysis where you specify what happened in the experiment. For your reference, here is the description of the experimental paradigm:
* A static checkerboard is displayed for the first two TRs (4s).
* Alternating blocks of flashing and static checkerboards begin with the third TR. The first block displays a flashing checkerboard for 10 TRs (20s). The second block displays a static checkerboard for 10 TRs (20s).
* This set of flashing/static blocks is repeated six times: F-S-F-S-F-S-F-S-F-S-F-S.
* After the final static block, another 6 TRs (12s) of flashing checkerboard appeared before the run ended.
* The subject tapped his/her fingers repeatedly whenever the checkerboard was flashing.
You need to create a three-column text file that describes your experimental paradigm. Each line of the file consists of three values, separated by tabs.
* The three columns are: Start of event (seconds), Duration of event (seconds), and Intensity of event.
* So, for the first row of the text file, we could use:
<code>4 20 1</code>
* You need to create a text file that has seven rows, each corresponding to one of the blocks of visual stimuli. Save this file in your FSL directory as block_3col.txt.
Now, you can go back to the Stats tab, and then click on Full model setup.
* In this experiment, only one thing happens: a checkerboard flashes. So, we only need one Explanatory Variable (EV). Type Flash into the EV name field.
* On the Basic shape pull-down menu, select Custom (3 column format). When the Filename box pops up, select the block_3col.txt file that you just created.
* On the Convolution pull-down menu, select Double-Gamma HRF. Leave Phase at 0 seconds.
* Add temporal derivative should be unchecked (gray).
* Apply temporal filtering should be checked (yellow).
You can now click on View Design, and you should see something that looks like the predicted hemodynamic changes that should follow alternating blocks of activation and deactivation. Close the window that just popped up (not your main FSL window), and hit “Done”.
===== Running FSL (First-level analysis)=====
You are now ready to run a first-level analysis (i.e., one run of one subject).
- Click the save button. Go to your /FSL directory. Save it as template.fsf; you'll need to type that file name at the end of the selection box.
If you are doing this as a class exercise, FIND YOUR TA AND TELL HIM/HER YOU ARE READY. Then, you can hit GO. The FEAT Watcher window should pop up; this lets you follow the progress of your analysis. Be patient and you should see FEAT begin running. This generally takes about 1 hour to completely analyze the one run.
====== Looking at your FSL analyses ======
FSL creates HTML pages for your output; these can be viewed in Internet explorer or any other browser.
- Open your FEAT report by entering the run#.feat folder that should be located in the run# folder.
- Compare your FEAT report to the one in Students/Example/FSL/Run#
You can also view the FSL output using ShowSrs2.
- In the Reg subdirectory that was created, load the hires.nii file for your anatomical image.
- To get your analyzed data, go to the Stats** subdirectory and load the zstat1.nii image (or similar).
- The anatomical image is has 256*256*21 voxels; the functional image has 64*64*21 voxels.