Shared Matlab Code for FMRI:
f-ASL and Ortho
An interactive tool for analysis of arterial spin labeling functional MRI time series data. It includes preprocessing, physiological noise correction, OLS and GLS analysis, as well as quantification of perfusion.
An interactive tool for visualization and ROI analysis of FMRI time series data. This tool also includes Granger Causality Analysis (use at your own risk)
This TAR file contains several tools for image display and analysis in matlab. There are a lot interdependencies between the functions, so I recommend that you download the whole toolbox to avoid problems. Some of these functions also use functions from SPM.
tar xvf LuisTools.tar
2. Add that directory to your Matlab path
For instructions on how to use a specific function from the toolbox, say, "blah.m", simply type (within matlab)
> help blah
and you will get instructions on the usage input and output.
Download the whole Toolbox here:
(Both of the programs described here
come bundled in a single tar file.)
Brief User's Manual (f-ASL) :
To start F-ASL, run Matlab and execute the command:
2.) is creates the design matrix for unsubtracted ASL data for you.
3.) if analyzing unsubtracted data, the program will do GLS estimation (prewhitening of the data). See:
Mumford, J.A., Hernandez-Garcia, L., Lee, G.R., Nichols, T.E., 2006. Estimation efficiency and statistical power in arterial spin labeling fMRI. Neuroimage 33, 103-114.
Hernandez-Garcia L, Jahanian H, Rowe DB: Quantitative Analysis of Arterial Spin Labeling FMRI Data Using a General Linear Model. Magnetic Resonance Imaging, 28 (7), Pages 919-927, 2010. [PMID: 20456889]
5) If you know how to program matlab, you can run it in a batch mode (skipping the GUI) by calling the “master program” from a script. FASL is just a nice GUI wrapper around this other program. The program file is asl_spm01.m . To use it, all you have to do is update the contents of the structure “args” and call
Type help asl_spm01 to get a complete listing of the contents of “args” and how to use it.
Screen shot of the F-ASL interface
(4) The smoothing tool is set up to use a Gaussian kernel with 3 voxels width.
(5) The realignment is done by SPM 5 and the data get resliced.
(6) The quantifiation model assumes you are running a continuous type of ASL scheme, like pseudo CASL.
Run Matlab and execute the command:
But, if you are one of the lucky ones to have Matlab 7 and later and you are using the GUI, the interface looks like the picture on the right:
Screen shot of the ORTHO interface
- display the images in orthogonal views,
- average events from a time series,
If you fill in the "time series" only, you will get a plot of the time series at whatever voxel you click on. To fill in the "Time Series" field, select one of the images in the time series. ORTHO will assume that they all are named the same except for the numbers at the end of the name. eg-
2. Stuff you can do to the time series:
You can also add detrending (3rd order polynomial) and
gaussian filtering to the time series by checking the appropriate box.
The filter parameters are hard-coded. They should be user defined, but
that's not implemented yet... sorry... it's easy to hack if you have the
3. Ovelaying a Statistical Map:
If you fill in the "anatomical" and
"stats map 1", you will get a display of the anatomical image with
the statistical map overlayed on it. You can select the threshold by
filliing in the threshold value field. These images must be coregistered
previously. They can have different resolutions, but they need to
be in the same orientation with the same origin. Remember that ORTHO
does not use the .mat files generated by SPM's coregistration so it doesn't
apply the transformations on the fly the way SPM does.
4. Selecting ROI types:
If you fill in the "Anatomical", "Stats Maps" and "Time Series", you can also select a specfic set of voxels to extract the information from. The values in those voxels get averaged together. You can choose what kind of ROI to use in the upper right side of the interface:
1. Cube: means that you get the voxel you click on plus the number of neighbors in each direction specified in the field labeled "ROI size". The default is cube with zero neighbors.
2. Thresholded Sphere: means a sphere with the radius in mm specified in the field labeled ROI size.
3. Mask File: means an Analyze format image in which the voxels of interest have value 1. All others have value of zero.
4. Voxel File means that the ROI consists of a list of voxels specified in an ASCII file, which you have to select by clicking the "Mask File / Vox. File" Button, or just typing in the file name in the field below that button. About the aforementioned voxel file, it needs to be an ascii (text) file that looks like this example:
12 43 45
Those coordinates are in voxel units and they are relative to the first voxel in the file - the one in the lower left corner, NOT the orgin!
5. Computing Granger Causality Maps:
There is a CheckBox at the bottom of the GUI that says "Do Granger". IF this is checked, as soon as you RIGHT-click on a pixel, the program will compute the Granger Causality F score between the current ROI and the rest of the image. The resulting files are named :
grangerFab - F score
of the influence of seed on each voxel
Be careful with Granger Causality; Whether it’s appropriate for BOLD time series data is not clear at all!
Last edits: 8/5/2010 - Page created and maintained by Luis Hernandez-Garcia at UM