Skip to main content Skip to navigation




Statistical Parametric Mapping Diagnosis

A toolbox for SPM

By Wen-Lin Luo, Hui Zhang & Thomas Nichols


This page...
SPMd5b bugs and fixes
SPMd2 bugs and fixes
SPMd2 example for single condition
SPMd2 example for multiple condition
SPMd2 example for group data
SPMd99 manual


SPMd for SPM5, SPMd5b, released October,2006!

See release notes  

SPMd2, the latest SPMd toolbox for SPM2 is available

See below for details


SPMd is a toolbox for SPM which you to establish the validity of inferences in fMRI modeling through diagnosis of linear model assumptions, and to characterize fMRI signal and artifacts through exploratory data analysis.

Currently there are two versions, SPMd99, a version for SPM99, which is no longer being developed, SPMd2, a version for SPM2.

To download please fill out a brief registration form so we can track SPMd usage. You will then be given a URL with an embedded keyword which will let you download the software.

To get started with spmd99, see getting started notes

If you do download it and find it useful (or not!), or have any problems, please let us know,


SPMd5b - released October, 2006

This is the SPMd toolbox for SPM5. While it has been tested in-house, it is still considered a beta release.

SPMd5b has all the features for SPMd2 plus the same image read and write functionality as SPM5.

In addition to using SPM5 library routines, the results output format is closer to the SPM5 format. Specifically, it will read Analyze and NIfTI images and write NIfTI images.

Distribution and installation instructions are given below.

Please report bugs to <>. Peculiarities and general queries should be raised on the SPM email discussion list. We will report patches to the list and make updates available if necessary. top


SPMd2 - released 13th June, 2005

  • SPM2 Compatibility

    In addition to using SPM2 library routines, the results output format is closer to the SPM2 format. Also, SPMd2 has the 'click-to-see' feature of SPM2's results page.


Distribution and installation instructions are given below.

Please report bugs to <>. Peculiarities and general queries should be raised on the SPM email discussion list. We will report patches to the list and make updates available if necessary. top


SPMd distribution & installation

The SPMd toolbox is a small suite of MatLab functions and M-files that integrate with SPM routines. Thus, to use SPMd2 you must have already installed SPM2, and to use SPMd5b you must have already installed SPM5. See the SPM distribution page for SPM hardware & software requirements, downloading & installation instructions, and conditions of distribution. You should be familiar with SPM2 before using SPMd.

The software is available via FTP, but we ask you to complete a brief registration form prior to downloading. Having completed the form, you will be directed to the download location, via a keyword enabled FTP URL. You should also periodically check the SPM5b bugs & fixes area and SPM2 bugs & fixes area.

Note SPMd99 is still availble. Use the same registration form to request the SPMd99 FTP URL.

Installation is relatively straightforward. Download the gzipped tar file and unzip it in a location where you want the SPMd5b or SPMd2 directory. Then, add the full pathname of this directory to your MATLABPATH. (You can check this by typing which spm in MatLab and examining the path, or try spm ver.)

You should also download any SPMd5b fixes or SPMd2 fixes, and replace older files shipped in the standard distribution.

For step by step instructions on downloading and installing SPM distributions, refer to the SPM distribution page. top



In addition to the main SPM documentation, you are encouraged to read


There are currently two versions of one paper available on the methods mbodied in SPMd. The published manuscript is available at the NeuroImage website (or email for a PDF), while the full version, as submitted is available freely on the web:

  • Wen-Lin Luo and Thomas E. Nichols
    Diagnosis and exploration of massively univariate neuroimaging models.
    NeuroImage 19:1014-1032, 2003.
  • Wen-Lin Luo and Thomas E. Nichols
    Diagnosis and Exploration of Massively Univariate 4D Spatiotemporal Models.
    Technical Report. Download: SPMd.pdf
  • The essential difference between the two versions is that the submitted version has detailed appendicies on the derivation of the various diagnostic statistics used. top


    SPMd is being made freely available to the functional Neuroimaging community in the same spirit as SPM. As with SPM, SPMd may be considered academic shareware. It is supplied as is, and no formal support or maintenance is provided or implied.

    General SPMd issues and idiosyncrasies should be raised on the SPM email discussion list, at <>, which the authors monitor. Direct queries to the authors will usually be answered to the whole list.

    The SPMd authors may be contacted at <>. Please report bugs to the authors direct. Suggestions for improvement are welcome, particularly those substantiated with code! Requests for specific design PlugIns will be considered, but necessarily as invitations for collaborative work.

    See the SPM documentation & support page for further resources. top


    SPMd5b bugs and fixes

    This section describes the bugs that have been reported, along with the appropriate fixes. Updated versions of appropriate SPMd5b functions are available from our anonymous FTP server in the spmd5_updates directory:

    In recent update, we change the spm_get used in SPM2 frequently to spm_select used for SPM5.The updated files are provided in the above FTP link. Brief descriptions of the fixes are provided below.

    • spmd.m

      Cleaned up special case of missing rotation/translation parameters.
    • spmd_comp_SS.m

      1. when the user specified covariates are among the design matrix, hide them from the design matrix
      2. determine whether the visible matrix is one column or not, if it is multiple column matrix, only show the maximum value for each row. However, if it is a single column matrix (vector), do not do any change. top


    SPMd2 bugs and fixes

    As of November 2nd, a number of fixes to SPMd2 have been posted and the distributed release has also been updated. (And a few more on Nov 4th!) If you've already downloaded SPMd, you can download all of the fixes at once here: 051104.tar.gz.

    Brief descriptions of the fixes are provided below; we'll post more comprehensive descriptions soon! All are contained in the spmd2_updates/ directory

    • spmd_stat.m

    • spmd_check_registration.m

      (2005/11/01) v1.5
      Previously SPMd's orthogonal viewers (Model Summary and Scan Detail views) displayed images in voxel space. Now they display images in world space.
    • spmd_MD.m

      (2005/11/01) v1.3
      Model detail window now displays current voxel in both voxels (voxel space) and mm (world space).
    • spmd_MD.m

      (2005/11/01) v1.3
      Model detail window now displays current voxel in both voxels (voxel space) and mm (world space).
    • spmd_project_vol.m

      (2005/11/01) v1.1
      New function; supports the viewing of MIP's in the orthogonal viewers (Model Summary and Scan Detail views).
    • spmd_comp_MS.m

      (2005/11/01) v1.10
      Minor code change; should have no impact.
    • spmd_orthviews.m

      (2005/11/01) v1.6
      Several important bug fixes regarding the "right-click jump to Model Detail": This didn't used to work in the Scan Detail view, but now it does; the voxel viewed in Model Detail was actually the voxel previously clicked; this lag has now been fixed.
    • spmd_SS.m

      (2005/11/01) v1.15
      Moved some computation to spmd_comp_SS.m; improved naming and ballon help.


    • spmd.m

      (2005/11/01) v1.3
      Minor typos and corrections to ballon help text.
      (2005/11/04) v1.4
      Now simply assumes that results are in current directory, so no need to select SPM.mat file (multiple times).
      (2007/06/05) v1.5
      Double checking whether there is rotation and shift parameters exist
    • spmd_SD.m

      (2005/11/04) v1.3
      Tiny change: Default window on residuals is now [-3,3], instead of [-5,5].

    • spmd_comp_SS.m

      (2005/11/01) v1.14
      Scan Summary computation now supports variables of no interest. Realignment parameter sought now corresponds to SPM2 naming convention. Moved some computation from spmd_SS.m.
      (2005/11/03) v1.15
      Major bugs in v1.14!! Now should work with all possible fMRI and non-fMRI designs. (Trouble was in code that figures out which columns to show in the Scan Summary predictor plot).
      (2005/11/04) v1.16
      In some settings, after selecting regression parameters the entire SPMd UI would vanish! Fixed
      (2006/09/28) v1.17
      Detect whether the user specified covariates exist before we do something for scan summary.


    We are indebted to everyone who has tried the software and reported bugs. We appreciate Helmut Laufs, Rute Martins, Juanjo Lull for reporting bugs for SPMd5b. top


    SPMd authors at <> Last modified: Mon Feb 4 15:02:52 EST 2008


    Contact Info

    Room D0.03
    Deptment of Statistics
    University of Warwick
    CV4 7AL
    United Kingdom

    Tel: +44(0)24 761 51086
    Email: t.e.nichols 'at'
    Blog: NISOx blog

    [Book Cover]

    Handbook of fMRI Data Analysis by Russ Poldrack, Thomas Nichols and Jeanette Mumford