wiki

FSL Fmri Analysis

Overview

FSL is a powerful tool for the analysis of many times of neuroimaging data, including BOLD / fMRI. I put together some scripts and a general pipeline to go through the multiple steps of processing, and sharing them might be helpful for learning or establishing a pipeline in a different environment.

GUI Tutorial

Pipeline

Preprocessing and Single Subject Analysis

The first part of this pipeline is intended to move subject data from raw data through First Level Analysis. For a detailed description of each step of this process, see fMRI Analysis Piecewise. fMRI Analysis Piecewise includes running QA, which is not included in the new fMRI Analysis Pipeline because it is done automatically on the scanner.

The Scripts

Once the design is ready and QA checked, the entire process is run with a set of scripts: For all Preprocessing and FEAT Analysis

These scripts do the following:

Organization of Script Running

This is the first time that you are running a script! See Running Scripts for an overview.

Script Text Log

It would be a good standard to have a place/file to keep track of script running, since each run will likely require various checks and you might want to make notes about data to leave for future users. You might have different sections to keep track of order numbers, tasks and design, contrasts, as well as an organizational tab to keep track of folders, and a data log to keep track of who has what.

Running the Scripts

Save the scripts to your head node on your cluster as PREPROCESS_FEAT.py and PREPROCESS_FEAT_TEMPLATE.sh, insert all relevant variables into the python, make sure to make them both executable with:

chmod u+x PREPROCESS_FEAT.py
chmod u+x PREPROCESS_FEAT_TEMPLATE.sh

and then to run, type:

python PREPROCESS_FEAT.py

It’s good to test on one dummy subject before submitting a huge batch. When you finish with Preprocessing and First Level FEATS, you must do FEAT Level 1 Quality Check before any group analysis.

If you want to do just preprocessing, or just FEAT, use these scripts:

For just Preprocessing

For just FEAT

Level 2 Analysis

If we want to combine runs, then we use FEAT level 2 analysis. Level 2 produces a .gfeat file for each subject. Running the second analysis creates COPE files for each subject, and eliminates the messy organization of subject by design type. If we only have one run, then we don’t need to do level 2 analysis. We can then move on to Level 3, which is a group analysis. My lab never did any combination of runs for level 2, so I never put together a script.

GROUP FEAT Analysis

Just like with first Level FEAT, the setup for a group level FEAT is done in the GUI.

Quality Check

ROI

Drawing ROIs

We next need to create ROIs for each subject, using the significantly activated regions as a mask found in the GroupFEAT analysis. To do this, we must first create the mask, then use it in featquery, and then compile results.

  1. Create ROI Masks
    • for functional data: can be done with a script that extracts the main clusters, or drawn in MRIcron
    • for anatomical data: we can use an atlas

A FEW MASKING OPTIONS

  1. Featquery runs via scripts and you must define your subjects, cope numbers of interest, and masks of interest
  2. fq_read takes the individual featquery output and compiles them into one text file, the script output file