AFNI (Analysis of Functional NeuroImages) is a suite of programs for looking at and analyzing MRI brain images at all stages of analysis (planning, setting up acquisition, preprocessing, analysis, quality control and statistical analysis). It contains C, Python and R programs, as well as shell scripts, primarily developed for the analysis and display of multiple MRI modalities:
- functional MRI (FMRI) * resting state, task-based or naturalistic paradigms * single- or multi-echo acquisitions
- anatomical/structural MRI * at various field strengths
- diffusion weighted imaging (DWI) * for DTI or HARDI modeling and tractography
Many AFNI programs have been applied and adapted to other modalities, such as ECoG, EEG, MEG, and more.
It has graphical displays for both slice-wise and surface-based viewing. In both cases, many aspects of visualization can be scripted for automatic image generation.
Please visit these websites for more information and to ask questions:
You can install AFNI on various Linux, macOS and Windows systems. Detailed instructions for each system are provided here. This is the way most users get the AFNI code to use.
Please make sure to use the AFNI system check to help guide you in the process, as well facilitate asking questions:
afni_system_check.py -check_all
Installing AFNI on your system
Educational resources
Code, command, script and functionality examples
Additional resources
AFNI benefits from integration and collaboration with several other actively developed neuroimaging software packages. We greatly appreciate the work of (and often the discussions with) their developers, and note some of these projects here. Further useful dependencies are cited within the codebase.
The following software are distributed within AFNI directly:
AFNI also has several programs and features that complement directly with the following projects:
- FreeSurfer,
via
@SUMA_Make_Spec_FS
andafni_proc.py
- LayNii, for layer FMRI processing and visualization
- tedana,
via
afni_proc.py
- TORTOISE, via the FATCAT and other DWI tools in AFNI
One aspect of AFNI's wide usage and motivation for maintaining long-term stability is that it serves as an underlying part within several other software projects and pipeline tools in the field. Some projects that use AFNI include:
- BrainSuite: Functional Pipeline: open-source workflow for processing FMRI data
- C-PAC: Configurable Pipeline for the Analysis of Connectomes software package
- DPABI: Data Processing & Analysis for Brain Imaging software suite
- ENIGMA HALFpipe: software from a consortium combining imaging and genetics
- fMRIPrep: FMRI preprocessing pipeline that combines tools from well-known software packages
- LONI QC: data review platform for neuroimaging studies with one or more centers
- Micapipe: a processing pipeline to analyze multimodal MRI data
- NeoRS: Neonatal Resting State fMRI data preprocessing pipeline
- NeuroDebian: an open, turnkey platform for neuroscience, integrating software
- NeuroDesk: open platform of data analysis environments for reproducible neuroimaging
- Nipype: an open-source initiative to integrate different packages in a workflow
- PESTICA & SLOMOCO: physio and slice-oriented motion correction tools
AFNI developers also lead the maintenance of the following fundamental neuroimaging repositories:
These are the code for the standard volumetric and surface dataset formats, respectively, in MRI. These formats are central to how software input/output standard data, and most neuroimaging packages in the field (including AFNI itself) use at least one of these formats.
NIFTI was first developed by a consortium of neuroimaging developers in 2004, with AFNI's Bob Cox being a primary architect and first author of the format description, which is still so widely used today:
- Cox RW, Ashburner J, Breman H, Fissell K, Haselgrove C, Holmes CJ, Lancaster JL, Rex DE, Smith SM, Woodward JB, Strother SC (2004). (sort of) new image data format standard: NiFTI-1. Presented at the 10th Annual Meeting of the Organization for Human Brain Mapping.
Currently, the top directory contains three sub-directories, each with further code stratification:
- doc/
- documentation for AFNI (though this is outdated; current doc content resides in its own git tree here: https://github.com/afni/afni_doc)
- src/
- source code for AFNI
- src/python_scripts/
Python command programs and library files; distributed together as the afnipy module, which can be imported and used as:
from afnipy import ...
- tests/
- tests for AFNI codebase
In addition to standard installation of AFNI on computers, you can also compile the code locally on your computer (e.g., for development). In src/, you need to choose one of the Makefile.* files that is closest to your system, and cp it to be named Makefile. Makefile is set up to install into the INSTALLDIR location, defined in that file -- you should probably change that to be appropriate for your use.
If you are using Mac OS X, choose one of the Makefile.macosx_* files.
For later versions of Mac OS X, Apple's C compiler does not support OpenMP, so we recommend downloading and installing a version of gcc from http://hpc.sourceforge.net/ or purchasing a commercial C compiler (e.g., Intel's icc) that does support OpenMP. Several important programs in the AFNI suite are parallelized via OpenMP, and will run much faster if compiled appropriately.
If you are using Linux, try Makefile.linux_openmp_64 first.
To make and install everything do:
make vastness
The command:
make cleanest
will remove all the *.o files, etc.