Automatic analysis
Matlab M
Latest commit b9c74b9 Jul 22, 2016 Rhodri Cusack Revert "Revert "Revert "New functions to support requirement for head…
…er files with NIFTI import"""

This reverts commit 285d2fe.

I didn't mean to commit to v5-stable
Failed to load latest commit information.
aa_config cleanup: omit seriesnamingconvention Sep 21, 2015
aa_engine Revert "Revert "Revert "New functions to support requirement for head… Jul 22, 2016
aa_modules Revert "Revert "Revert "New functions to support requirement for head… Jul 22, 2016
aa_recipes_and_parametersets NEW FEATURE: multiple megname Mar 2, 2016
aa_testcode Added a testing module Nov 11, 2013
aa_toolbox DEBUGs Mar 18, 2016
examples modified to reflect new requirement for header file Jul 22, 2016
.gitignore NEW FEATURE: `threshold` option for amod_waveletdespike Mar 23, 2016 DEBUGS Mar 14, 2016
aaClass.m UPDATE: version change Mar 14, 2016
aa_ver5.m UPGRADE: aa v5.0.0 Feb 8, 2016
license.txt neurana config changes Aug 25, 2013

Automated Analysis software was originally developed by Dr Rhodri Cusack for supporting research at the MRC Cognition and Brain Science Unit. It is made available to the academic community in the hope that it may prove useful.

Definitions: aa means the Automated Analysis software package and any associated documentation whether electronic or printed.


Use of this software is subject to the terms of the license, found in the license.txt file distributed with this software.


aa is a pipeline system for neuroimaging written primarily in Matlab. It robustly supports recent versions of SPM, as well as selected functions from other software packages. The goal is to facilitate automatic, flexible, and replicable neuroimaging analyses through a comprehensive pipeline system.

More information can be found on the aa webpage:



aa is maintained on github. The most recent version can be found at:


Unzip the downloaded package, and add the main folder to the MATLAB path.


Some parameters (path settings, format settings) stored in /aa_recipes_and_parametersets/aap_parameters_defaults.xml have to be configured. Instead of editing the main aap_parameters_defaults.xml, we recommend to create a local version by inhereting most of the settings from aap_parameters_defaults.xml. See aap_parameters_defaults_CBSU.xml as an example.

  • directory_conventions/rawdatadir: Directories to find raw MRI data
  • directory_conventions/subjectoutputformat: sprintf formatting string to get subject directory as stored in directory_conventions/rawdatadir
  • directory_conventions/seriesoutputformat: sprintf formatting string to get series directory as stored in subject directory
  • directory_conventions/protocol_structural: Name of the structural/anatomical protocol as stored in the DICOM header
  • directory_conventions/dicomfilter: Directory listing filter to find DICOM data
  • directory_conventions/spmdir: Path to SPM. N.B.: You should not modify SPM version in your UMS but rather in your local parameter file. Optional:
  • For distortion correction using fieldmap:

    • directory_conventions/protocol_fieldmap: Name of the fieldmap protocol as stored in the DICOM header
  • For multichannel segmentation using T2-weighted image:

    • directory_conventions/protocol_t2: Name of the T2-weighted protocol as stored in the DICOM header
  • For MEG:

    • directory_conventions/rawmegdatadir: Directories to find raw MEG data
    • directory_conventions/megsubjectoutputformat: sprintf formatting string to get subject directory as stored in directory_conventions/rawmegdatadir
    • directory_conventions/neuromagdir: Path to Neuromag (maxfilter)
  • Optional analysis software:

    • FMRIB Software Library:

      • directory_conventions/fsldir: Path to FSL
      • directory_conventions/fslsetup: Path to FSL setup/configuration script to be executed before any FSL command
      • directory_conventions/fslshell: Shell used to run FSL. It should be in accordance with directory_conventions/fslsetup
      • directory_conventions/fsloutputtype: Output type used by FSL ("NIFTI" recommended)
    • FreeSurfer:

      • directory_conventions/freesurferdir: Path to FreeSurfer
      • directory_conventions/freesurfersetup: Path to FreeSurfer setup/configuration script, executing before any FreeSurfer command
      • directory_conventions/freesurfershell: Shell used to run FreeSurfer. It should be in accordance with directory_conventions/freesurfersetup and directory_conventions/freesurferenvironment
      • directory_conventions/freesurferenvironment: Path to FreeSurfer environmental setup script, executing before any FreeSurfer command
    • directory_conventions/eeglabdir: Path to EEGLab

    • directory_conventions/GIFTdir: Path to GIFT
    • directory_conventions/ANTSdir: Path to ANTS
    • directory_conventions/fieldtripdir: Path to FieldTrip
    • directory_conventions/BrainWaveletdir: Path to BrainWavelet
    • directory_conventions/spmtoolsdir: Path to external/custom SPM toolboxes
  • Parallel processing:

    • directory_conventions/qsubscheduler: MATLAB function to set up qsub scheduler to execute jobs in the cluster (should be in your MATLAB path)
    • directory_conventions/poolprofile: MATLAB function to create cluster profile for parallel processing in a local job (should be in your MATLAB path)

Help and support

In addition to the wiki, there is also a discussion list:

Software updates

The master branch on github will always have the latest stable version. To be notified when a new version is available, please sign up for the automaticanalysis-announce email list:

References and citation

For any papers that report data analyzed with aa, please include the website ( and cite the aa paper:

Cusack R, Vicente-Grabovetsky A, Mitchell DJ, Wild CJ, Auer T, Linke AC, Peelle JE (2015) Automatic analysis (aa): Efficient neuroimaging workflows and parallel processing using Matlab and XML. Frontiers in Neuroinformatics 8:90.