Skip to content


Personal tools
You are here: Home » Misc Items » AFNI Startup Manual

AFNI Startup Manual

Document Actions

Getting Started with AFNI

Most of this document consists of statements to RTFM.

Overview of the AFNI Package

The biggest piece is the interactive AFNI program, which is used to view data and perform some analysis functions. There are about 30 auxiliary programs which operate on 3D or 3D+time datasets (see below). These programs are run from the command line, and most of their names start with the character "3d" - for example, program 3dANOVA. There is also about a dozen older programs that operate on 2D images; their names generally start with "im", as in program imrotate.

The whole package is a big thing to swallow at one brain gulp. I recommend getting the sample datasets and playing with them a little with the interactive program, while reading the manual afni200.pdf. Then figure out how to put your own data into the AFNI dataset format, and away you go!

Organizing Your Data into "Datasets"

Most of the programs in the AFNI package operate on "datasets", which comprise image data (3D or 3D+time) plus header information. The first thing you must do is to put your image data into the dataset format. This is done with the program to3d, which is documented in the file afni_aux.pdf. Briefly, with to3d, you assemble the image data into one big file, and also describe the geometrical layout of the images (orientation, voxel dimensions, position in the scanner, etc.).

There are two types of datasets: Anatomical and Functional. Data direct from the scanner is Anatomical. Functional datasets are derived values designed to show where brain function is happening. Therefore, you almost always use to3d to create anatomical datasets. However, it is possible to create functional images outside of the AFNI package in some way (your own custom code, perhaps) and then assemble those images into a functional dataset for viewing with the interactive AFNI program.

Datasets can be "3D" or "3D+time". The latter consists of 2 or more 3D volumes of voxel data that are to be considered as having been gathered in temporal sequence. In the AFNI program, 3D+time datasets can not only be displayed as images, but can be graphed vs. time. More germanely, a 3D+time dataset can be processed using the "correlation method" to produce a functional dataset - that is, a 3D dataset that when properly displayed is a brain activation map.

The sample 3D+time dataset, in the file "sample96.tgz" is a good place to start. You can use to3d on it, and also use it to play with the AFNI display and analysis tools. Information about how to read your particular (not to say peculiar) 2D or 3D image format can be found on the AFNI FAQ List.

Analyzing 3D+time Datasets

The basic analysis method incorporated into AFNI is the correlation method, developed by Bandettini et al. This technique takes a reference function, r(t), and correlates it with each voxel data time series v(t). At each voxel, the correlation coefficient is calculated; this can be used a threshold to select which voxels are to be deemed "active".

At MCW, we refer to the results of the correlation method as "FIMs", named after the first program that implemented this algorithm (FIM=Functional IMage?). In AFNI, a FIM is computed from a 3D+time dataset via controls present on the Graphing window. The procedure is explained in the main manual for AFNI, afni200.pdf.

You may want to register (align) your images before functional activation analysis. This can be done using the program 3dvolreg, which takes one 3D+time dataset as input, and produces a new one as output (hopefully a better one). At present, the only documentation for this program is the output of "3dvolreg -help". (Most programs in this package take the command line option "-help", which will print out a terse summary of the program's usage. This is the AFNI package analog of man pages.)

Displaying Function Overlaid on Anatomy

Functional time series are usually gathered at a coarse resolution, and the derived activation maps are usually overlaid in color onto higher resolution anatomical datasets displayed in grayscale. This is one of the main functions of AFNI. It is important to use to3d properly so that the geometrical overlay is computed correctly. If you don't give the proper spatial location of the datasets, then AFNI will surely not be able to properly place the function on top of the anatomy!

The grid for displaying images is always controlled by the current anatomical dataset being shown in AFNI. If needed, the functional dataset will be resampled (interpolated) to the anatomical grid before being used to compute the overlay colors. This process can be controlled by the "Define Datamode" control panel on the main AFNI control window. The correlation threshold and functional-intensity-to-color mapping are controlled from the "Define Function" control panel. To actually see the color overlay for a functional dataset, the "See Function" toggle must also be turned on.

Created by Robert Cox
Last modified 2005-08-27 01:37

Powered by Plone

This site conforms to the following standards: