Automatic analysis (aa) is a pipeline system for neuroimaging, written in Matlab. It supports SPM 5/8 and some functions from FSL.
As of December 2020, AA is deprecated at CBU. The last update that was deployed at CBU is release 5.4.0_202008, which is available on the imaging system under /imaging/local/software/AA/release-5.4.0_202008. For critical errors in existing pipelines, please contact Johan Carlin for support. For new projects, please investigate alternatives such as nipype, which is available at CBU as part of the Neuroconda environment.
AA continues to be developed outside of CBU, and its developers can be reached on the project Github page.
The documentation below is outdated and should be read with caution.
For more information see:
<<TableOfContents: execution failed [list index out of range] (see also the log)>>
Paths to aa
Different versions live in:
legacy versions (0.1beta - 2.0) - unsupported
/imaging/local/spm/aa/aa-ver0.1_beta
/imaging/local/spm/aa/aa-ver0.2_beta
...
- old versions (2.2 - 4.beta)
/imaging/local/spm/aa_svn_new/versions/release-2.2
/imaging/local/spm/aa_svn_new/versions/release-3.0
...
new version (4.0 - 4.1) (based on the latest devel-share branch from GitHub)
/imaging/local/software/AA/release-4.0
/imaging/local/software/AA/release-4.2 - stable
/imaging/local/software/AA/release-4.2_[YYYYMM] - backups on [YYYYMM]
/imaging/local/software/AA/release-4.3 - recommended
Installing aa
Requirements
- Operating system: Linux only!
- Must-have:
MATLAB: tested on versions >=r2009a. In CBSU, you need r2012b for parallel computing
SPM: most functions work with SPM5 and SPM8, but full functionality requires SPM12
- For MEG: Neuromag (only ELEKTA systems are supported, so far)
Using aa
For a comprehensive summary, please read the latest manuscript. Please, do not forget to cite it when using!
Configuration
Before running aa you need to add the corresponding path to MATLAB Path:
- File/Set Path...
addpath('path_to_aa'); aa_ver4; % adds aa subfolders to the path savepath;
To avoid version conflicts make sure that it is added to the top of the Path. It is even more important that path_to_aa/extrafunctions/spm_mods is on the top (of SPM's paths), so modification to the spm may have effect.
Running
You need a
Optionally, you can also specify your own parameter settings loaded by aarecipe. E.g.: User-specific parameter settings (you may need to change the path pointing to the "parent" xml)
aap = aarecipe('aap_user_parameters.xml');
Features
Parallel computing
- Usage
To enable parallel computing you have to be logged in an appropriate computing machine (login11-14), make sure that our local MATLAB scripts for qsub (/hpc-software/matlab/cbu) is in your MATLAB path, which is there usually, but it is worth checking :), and add the following line to your UMS:
aap.options.wheretoprocess = 'qsub'; % parallel; typical localsingle
Because each thread will load the saved MATLAB path, it is very important that it is set and saved correctly before initiating parallel jobs. See Configuration for more information!
- Monitoring
Handling multiple DICOM sources
- Colon-separated-list (CSL) for rawdatadir:
- The “old” script should work without any changes but the newer ones (based on Recent Update on 2013/09/06) should revert. When multiple sources are defined, use CSL. E.g.:
aap.directory_conventions.rawdatadir = ‘/mridata/cbu:/mridata/csl:/mridata/camcan’; % default at the moment (see aap_parameters_defaults_CBSU.xml)
Support for NIFTI-4D images
- As a default, NIFTI-3D is set. To enable NIFTI-4D, you have to specify it in the UMS:
aap.options.NIFTI4D = 1; % 4D support; typical value 0
Multi-level interlinked reporting
- Levels:
- Study (reporting second-level)
- Subjects (each subjects separately)
- Summaries:
- Subjects
- Registration
- First-level thresholded maps
- Usage
Based on aap structure
aa_report(fullfile(aas_getstudypath(aap),aap.directory_conventions.analysisid));
- If you are in the analysis folder
aa_report;
Garbage collection
- Tidy up unnecessary files - delete any inputs to a module that are not also specified as an output.
- Usage:
Based on aap structure
aas_garbagecollection(aap,true);
- If you are in the analysis folder
aas_garbagecollection(pwd,true);
From v4.2, it is automatically performed at the end of the analysis according to aap.options.garbagecollection
"Inheritable" parameter settings
There is an option to have site-, user-, and/or study-specific parameter settings containing only the parameters to be overridden (see example).
Non-Standard Modules
- First-level thresholding
- List of significant activation maps
- Overlays on axial slices (T1 MNI)
- Rendering results in 3D
Advanced Features
Input file
It is possible to specify Subjects, Sessions and Events based on a text file. Required options in aap.acq_details.input (see also aap_parameters_defaults_CBSU.xml):
- list: text file:
- Required format:
a CSV file: cells are separated with semicolon
- subcells are separated with "_"
- a header in the first line
- Required columns (may contain more):
- "ID": numbers for identifying subjects
- "FMRI1": cells for the fMRI measurement; it must contain the same number of subcells as the coresponding column header
- first subcell is the CBU volunteer number (without "CBU")
- series numbers are defined in the consecutive subcells with the same order as their names in the coresponding column header
- E.g.:
- As "pure" text:
- ID;Age;Sex;FMRI1_Loc_Con_LDeasy_LDhard
- 02;29;f;90952_7_6_4_5
- Required format:
- selected_sessions: subselection of a subset of series:
E.g. (based on the example above): [3 4] --> LDeasy and LDhard
- referencedirectory_tmpl: a template for path to the folder containing Event files (.mat files in SPM-format)
- Required format:
must contain "*" which will be substituted withID (see above)
- E.g.: '/imaging/ta02/ActionWords/Analysis/E-Prime/DAW*/ref'
The folder should contain the regressor(s) in SPM format (.mat file) with filename format: condition_vol_ID-Session Name.mat.
- E.g. (based on the example above): condition_vol_2-LDeasy.mat
- Required format:
- Then you add these lines to your UMS (based on the example above):
aap.acq_details.input.list='/imaging/ta02/ActionWords/Analysis/Subject_List_Test.csv'; aap.acq_details.input.selected_sessions = [3 4]; aap.acq_details.input.referencedirectory_tmpl = '/imaging/ta02/ActionWords/Analysis/E-Prime/DAW*/ref'; aap = aas_processinput(aap);