fMRI ToolBox


I’ve developed several tools for working with fMRI images that are contained within the following distribution:

 

fMRIToolBox.zip

 

This distribution is a Microsoft Visual Studio 2007 distribution solution, although a good portion of the code is written in ANSI C++ and would be able to be compiled on any ANSI C++ compiler.  The main purpose of the software is to provide a tool to view fMRI images with Talairach region masks super imposed on the images.  The input files can be either in the Analyze format or in the Nifti format. 

 

The included software can also take a directory of fMRI images (assumed to be part of a time series of images and numbered chronologically) as input and output a text file that summarizes that provides a time series of the average activation values for regions of interest (ROIs) (defined by the Talairach database).  The columns of the text file represent ROIs, the rows represent time points (i.e., fMRI images) and the elements of the table represent the value a certain ROI took on in a specific fMRI image.  In actuality, several text files are created for different statistical measurements of the ROIs.  E.g., there is a “mean” file,  a “variance” file, a “median” file, a “highlow2” file (which represents a quantized version of the mean file), etc.

 

Inside the single solution are several projects (solution and project are specific Visual studio terms).  The following projects are included:

 

·         fMRIImage:  This project contains ANSI C++ objects that can be used for the following purposes:

o   fMRIImage.h:  This object can load a single fMRI image into an object.  There are several member functions that allow access to elements of the image as well as functions to save the image. 

o   TalairachDB.h: This object loads in the data for the Talairach database (Lancaster et al 2000) and provides functions that tell what ROI a particular voxel falls into.  This object operates much more quickly than the Talairach java implementation available elsewhere and (at least as of 2002) returns the exact same set of ROIs for every voxel that the official Talairach java daemon did (although I imply absolutely *no* guarantee nor warranty of this).

·         fMRIPrep: This project contains files that convert a directory of fMRI images into a table detailing the activation of ROIs across the time series of fMRI images.

o   prepData.cpp: This is the main file that is launched at the dos prompt

o   AVGPrepper.h, FMRIPrepper.h, PGMPrepper.h, SVMPrepper.h:  These files are the ones that prep the data.  They are called by prepData.cpp.  The one most people will be interested in is the FMRIPrepper.h object

o   ExpGenericInfo.h: This class defines an “experiment” object.  Such an object can add columns of information to the output text files (such as stimulus information).  Look at the code to figure out how this is done.

·         fMRITest: This project is just a mish-mash of blocks of code that do little experiments with fMRIImages and the TailairachDB objects.  It’s a (relatively) good project to look at to figure out how those classes work.

·         fMRIViz: This project is not ANSI C++.  It uses the Microsoft Foundation Classes (MFC) and is a graphical program that outputs fMRI images.  With the program, you can load up fMRI images, and then superimpose Talairach regions onto the image.

 

***IMPORTANT USAGE NOTE***

When fMRIPrep is processing images, it is placing the masks on the fMRI images as indicated by the fMRIImage.h object.  The problem is, this process is annoying.  Whenever I’d run into different datasets, the Talairach masks would need to be tweaked around a little to fit well (like the masks would be offcenter or backwards or inverted, etc.).  To make sure masks are being placed adequately when using fMRIPrep, first run fMRIViz and load up one of your fMRIImages and select some masks.  This will show you how the masks are being placed on your images. 

To change how the masks are placed, look in the fMRIImage.h file,  Part of the comments at the very top tell you where to go in the code to tweak the placement of the masks (where a “tweak” can be a huge change of course).  There are further comments in the code about different tweaks I’ve made in previous datasets.  In the end, the masks should be placed so that they appear reasonable.  I.e., that the left and right cerebrum line up approximately in the middle of the brain, that small ROIs look like they are placed correctly, that the tops and bottoms of the gray matter in the brain is covered by the Gray Matter ROI, etc.

***IMPORTANT USAGE NOTE***

 

See the source files for more comments on how to use them.

 

Included in the distribution are Microsoft window executables for fMRIPrep and fMRIVis (in the “Release” sub-directories in the appropriate project folders).  I believe that the .NET framework must be installed for fMRIViz to execute.

 

As of the writing of this web page (6/22/2007), this distribution compiled and ran correctly on my machine.  However, no one outside of my self has tested it.  Please let me know if the package doesn’t compile for you or the executables provided don’t run (for instance, perhaps there are some .dll files required to run the files that I am not aware of).  I am John Burge, my email address is on my main web site linked below.

 


References

Lancaster, J. L., Woldorff, M. G., Parsons, L. M., Liotti, M., Freitas, C. S., Rainey, L., et al. (2000). Automated Talairach atlas labels for functional brain mapping. Hum Brain Mapp, 10(3), 120-131.

 

Return to John Burge's home page