FSL-ROI
From Poldracklab Wiki
This project was initially created by Russ Poldrack (as an extension of the previous SPM ROI Toolbox), with subsequent contributions by Chris Rorden and Jeanette Mumford.
Development of this project is currently supported by NIH grants P50 MH077248 (UCLA CIDAR TRECC: Neuroimaging Core) and PL1 MH083271 (UCLA Consortium for Neuropsychiatric Phenomics: Imaging Unit).
Contents |
Installation
The FSL-ROI Toolbox requires the following software to be installed:
- FSL - Requires version 4
- Rotman NIFTI Tools
There are two ways to obtain the toolbox.
- The latest point release can be downloaded from the Sourceforge.net download page
- The most current versions of the files can be obtained via CVS:
cvs -d:pserver:anonymous@fmri-toolbox.cvs.sourceforge.net:/cvsroot/fmri-toolbox login
(just hit enter when asked for a password)
cvs -z3 -d:pserver:anonymous@fmri-toolbox.cvs.sourceforge.net:/cvsroot/fmri-toolbox co -P fslroi
This will download the latest version of the toolbox to a directory called fslroi. The code can then be updated using the following command while inside the fslroi directory:
cvs -z3 -d:pserver:anonymous@fmri-toolbox.cvs.sourceforge.net:/cvsroot/fmri-toolbox update
Timecourse extraction
The toolbox extracts timecourses for each condition at each voxel in the whole-brain mask, using a finite impulse response (FIR) model. The program selective_avg2.m performs this function. It takes a single structure as an argument, which allows the following settings:
- REQUIRED:
- params.featdir: FEAT directory for analysis
- OPTIONAL:
- params.MakeStandardSpaceImage = (default=1)
- if set to 1, then standard space versions of images are created; set to 0 to create only native space images
- params.StandardSpaceImage = location of standard space reference image (default = avg152T1 image from fsl/etc/standard)
- params.ter - effective temporal resolution of analysis (default = TR)
- note: Image Processing Toolbox is required for TER ~= TR
- params.PosWindow - positive time window for averaging (default=24 s)
- params.NegWindow - negative time window for averaging (default=4 s)
- params.sed_converter - full path of designconvert.sed - if you are not at UCLA then you will need to set this
- params.SaveVariance - set to 1 to save variance images (default=0)
- params.UseSmoothFIR - set to 1 to use smooth FIR (default=1)
- params.SmoothingParameter - determines amount of smoothing (default = 1/sqrt(10) as per Goutte et al., 2000)
- params.MakeStandardSpaceImage = (default=1)
This program is called as follows:
params.featdir='/example/dir/analysis.feat';
timepoints=selective_average2(params);
This creates the following directories within the specified feat directory:
- roi
- contains one image per condition with peristimulus timepoints as 4th dimension
- reg/roi
- contains standard space versions of timecourse images (if MakeStandardSpaceImage is set to 1, as per default)
- roi_var
- variance images (if SaveVariance parameter is set to 1)
- reg/roi_var
- standard space versions of variance images
ROI mask creation
There are two ways to create ROI masks for timecourse extraction within the toolbox. For more information about different ways of selecting ROIs, see:
Anatomical ROIs
The program get_mean_atlas_timecourses.m will use an anatomical atlas to estimate the mean timecourse for every anatomical region in the atlas. It requires that one first use make_combo_atlas.m to create a combined version of the HarvardOxford probabilistic atlas.
Creating the combination atlas
cd $FSLDIR/data/atlases/HarvardOxford
then in matlab, run "make_combo_atlas"
This will create several new files:
- HarvardOxford-combo-maxprob-thr25-2mm.nii
- HarvardOxford-combo-maxprob-thr25-2mm: directory containing a separate file for each individual roi
- HarvardOxford-combo-labels.txt: a text listing of the ROIs
- HarvardOxford-combo-labels.mat: a matlab file with the labels
If you want to use a different atlas from the thr25-2mm version then you will need to edit the code to add the appropriate image reference.
Running the atlas averaging
Go into the first-level feat directory where selective_avg2 has already been run (with standard space images enabled). Run:
get_mean_atlas_timecourses
which will create reg/roi/atlas_timeseries.mat which is a MATLAB file containing a cell array called data that contains the timecourse for every condition and roi.
Functional ROIs
The program make_func_roi2.m takes a statistical map and creates a set of spherical ROIs at the local maxima within each significant cluster. The usage is:
make_func_roi2(zstat,thresh,radius,nmax)
REQUIRED ARGUMENTS:
- zstat: the statistical image to be used
- thresh: threshold to form clusters
- radius: radius of spherical ROIs (in mm)
OPTIONAL ARGUMENTS:
- nmax: number of maxima within each cluster, useful when there are large, extended clusters
Coordinate-based ROIs
Coordinates centered at a specific coordinate can be created using mk_sphere_mask2.m. Its usage is:
mk_sphere_mask2(loc,radius,img,outfilename,coordspace)
REQUIRED ARGUMENTS:
- loc: a 3x1 vector with x/y/z coordinates
- radius: radius of sphere in mm
- img: an image from which to obtain the space for the images
OPTIONAL ARGUMENTS:
- outfilename: name for mask image (default: sphmask_<X>_<Y>_<Z>_<radius>mm)
- coordspace: 'mm' for mm coords, 'vox' for vox coords (default: mm)
Extracting data using ROIs
The easiest way to extract data using an ROI is with the fslmeants command in fsl:
fslmeants -i roi/example_roifile.nii.gz -m roi/example_cluster001.nii.gz > cluster001_signal.txt
this will save the data for that cluster to a text file (cluster001_signal.txt) which can then be read into MATLAB or stats programs.
