Gannet logo

Current stable release:  3.1.5


Gannet is a free, open-source MATLAB-based software toolkit for analyzing edited 1H magnetic resonance spectroscopy (MRS) data. Its largely automated functions cover all the essential steps of modern MRS analysis:

Several existing software packages for MRS data analysis require substantial user input or offer a wide selection of processing options. In contrast, the philosophy behind Gannet is to provide users with a complete automated pipeline without the need for significant user input.

Additionally, as open-source software, advanced users have the ability to modify the underlying routines for ad hoc purposes.

Gannet is continually being updated and has an active support base. Visit our blog for the latest news on Gannet and our developments in edited MRS methodology.



Gannet runs in MATLAB. For best performance, we recommend using the latest release if possible. Additionally, Gannet requires that the following MATLAB toolboxes are installed:

  • Image Processing
  • Optimization
  • Signal Processing
  • Statistics and Machine Learning

You can check which toolboxes you have installed by typing ver in the MATLAB command window. To install any missing toolboxes, please follow these instructions.

To run the voxel co-registration and structural image segmentation modules, SPM12 must be installed.


The simplest way to install Gannet is to download the zipped master folder from the repository on GitHub, unzip it, and move the Gannet3.1-master folder into your MATLAB directory.

Alternatively, git-savvy users can clone the Gannet repository into a folder of their choice:

git clone


To add Gannet to your search path, run the following line of code in the command window:





Running savepath will permanently save all the paths currently in your search path to MATLAB’s default search path.

Alternatively, open the Set Path dialog box from the MATLAB menu, click Add with Subfolders, find the Gannet3.1-master folder and then select it. When done, press Save to permanently save the Gannet folder to MATLAB’s default search path.

Make sure to add the SPM12 folder to the search path as well.

   It is highly recommended that you only add the main SPM12 folder (spm12) to your search path rather than including all the subfolders. This prevents potential function conflicts.


Gannet is currently being developed in MATLAB R2019b in macOS 10.15 Catalina. While reasonable effort is made to ensure legacy and cross-OS compatibility, an error-free user experience is not guaranteed.

Supported file formats

At present, the following MRS data file formats are supported:

For creating and co-registering voxel masks, structural images need to be in NIfTI (Philips and Siemens) or DICOM (GE) format.

   Philips users: Do not use structural images exported using the fsl-nifti option as this creates problems with co-registration in Gannet.

Getting help

If you encounter any problems, please first check the Documentation or FAQ for a solution.

Otherwise, you can post your query on the Gannet forum on the MRSHub.

The support team can also be directly reached using our blog’s contact form. We will do our best to work with you to solve your issue.


Semantic versioning is used when updates are made to Gannet using the style ‘x.x.x’. Versioning is also conducted on a module-specific basis using the style ‘YYMMDD’. That is, each Gannet module has its own release version.


License and citing Gannet

This software is licensed under the open-source BSD 3-Clause License. Should you disseminate material that made use of Gannet, please cite the following publications, as appropriate:

For all work using Gannet:

If you perform frequency-and-phase correction (FPC) using:

Robust spectral registration (RobustSpecReg):

multi-step FPC (SpecRegHERMES):

or spectral registration (SpecReg):

If you perform tissue segmentation:

If you report water-referenced measurements tissue-corrected using:

The Harris et al. method:

or the Gasparovic et al. method:


The development and dissemination of Gannet has been supported by the following NIH grants:

We wish to thank the following individuals for their direct or indirect contributions:

Built with R Markdown and RStudio.

This work by Mark Mikkelsen is licensed under CC BY-NC 4.0