Download our software

The following software is open source, comes without warranty and is released according to the GPL-3.0 license.

Automatic analysis

This tool is widely used in Cambridge and elsewhere. It automates the analysis of functional and morphometric MRI data. Its strength is in providing an efficient workflow: allowing pre-built pipelines to be executed in just a few lines of code, executing them in parallel (with automatic dependency calculation), and recording which parts of an analysis have been completed so that partial analyses can be restarted.

aa version 3.01 is stable; aa version 4 is in beta.

Documentation wiki and instructions for download

Presentation to introduce aa [pdf]

Real-time fMRI

This is a Matlab-based real-time fMRI analysis suite. It can be used for neurofeedback or more complex designs such as Dynamically Adaptive Imaging.

This is beta-release software, and will require some integration with your system. The code for this is being developed substantially and moved to a google code project.

[Old site: Open source real-time fMRI]

Scanner noise cancellation

Sometimes, it is useful to be able to take verbal responses from people in the scanner. This tool is a tool to remove scanner noise from audio recordings. It requires recordings where the recording level was sufficiently low that the waveform of the scanner noise did not “clip”.

[zip] Scanner noise cancellation

Robust phase unwrapping tool

[zip] Robust phase unwrapping tool (Matlab)

Algorithm described in Cusack & Papadakis (2002), see below for reference. Unzip it first. You may need to compile the .mex file for your platform (typically, mex robustunwrap from matlab).

Usage:

>> robustunwrap([seedx seedy seedz],phasedata,magnitudeda)

where:

  • (seedx,seedy,seedz) are voxel coordinates of the starting point for unwrapping (perhaps the middle of your image?)
  • phasedata is a 3D double matrix of phase values
  • magnitudedata matches phasedata in size, and provides magnitude values

For example,

robustunwrap([32 32 32],phasedata,magnitudeda)

Controlling the level of sounds in Windows

There is a separate page describing these tools.

Undistortion of EPIs with a fieldmap

This tool, written in Matlab with some compiled Matlab (.mex) components, is designed to undistort EPI images using a fieldmap. To install the code:

  1. Download and unzip
  2. You’ll need SPM, so install and run this. SPM 5 was used for testing, but SPM 8 should work fine too (please comment below if you discover otherwise!)
  3. Unless you’re using 64-bit Linux, you’ll need to recompile the two mex components, by typing “mex robustunwrap.cpp” and “mex nnexpand.cpp” from the Matlab prompt
  4. IMPORTANT: change the following parameters in fieldmap_undistort_v403 to match your EPI acquisition
    phaseencodesign=-1;

    Is your acquisition ant>>post (put phaseencodesign=-1) or post>>ant (phaseencodesign=1)?

    episliceacqtime=60.62e-3;

    This is the time it takes for a single EPI slice to be acquired. You may need to ask your physicist for this

    fieldmapphase_scalingfactor=2*pi/4096;

    Siemens phase images are scaled so that a range 0-4096 corresponds to 0-2*pi. Adjust this for your platform if you’re not using a Siemens machine

    evoltime=2.46e-3;

    This is the difference (in seconds) between the two echoes you’ve used to get the fieldmap. Look it up on the console or ask your physicist.

  5. Run it. If you don’t provide any parameters, it will ask you to select images. These should be in Nifti (.nii) format. You’ll need four single images (fieldmap magnitude, fieldmap phase, meanepi, structural) and a set of images to be undistorted. Good luck!

If you find this tool useful, you might like to cite the following to explain what you’ve done:

Cusack, R. (2003) An Evaluation of the Use of Magnetic Field Maps to Undistort Echo-Planar Images, NeuroImage 18(1), p. 127-142, urlpdf

Cusack, R. , Papadakis, N. (2002) New Robust 3-D Phase Unwrapping Algorithms: Application to Magnetic Field Mapping and Undistorting Echoplanar Images*1,NeuroImage 16(3), p. 754-764, urlpdf