Skip to main content Skip to navigation

SnPM - Statistical NonParametric Mapping - A toolbox for SPM



Statistical nonParametric Mapping

A toolbox for SPM

Supported by the
Human Brain Project [HBP]

Developed by Andrew Holmes & Tom Nichols et al.


This page...
SnPM primer
bugs & fixes

bugs & fixes

bugs & fixes



SnPM pages...
PET example
fMRI example
FSL users


Suggestion for citing SnPM
Citation of the SnPM software can be made with reference to this URL which links to this page. Concepts implimented in the SnPM software are best described in the Nichols & Holmes (2001) paper; see references below.

SnPM: Statistical nonParametric Mapping

The Statistical nonParametric Mapping toolbox provides an extensible framework for voxel level non-parametric permutation/randomisation tests of functional Neuroimaging experiments with independent observations. The SnPM toolbox provides an alternative to the Statistics section of SPM. SnPM uses the General Linear Model to construct pseudo t-statistic images, which are then assessed for significance using a standard non-parametric multiple comparisons procedure based on randomisation/permutation testing. It is most suitable for single subject PET/SPECT analyses, or designs with low degrees of freedom available for variance estimation. In these situations the freedom to use weighted locally pooled variance estimates, or variance smoothing, makes the non-parametric approach considerably more powerful than conventional parametric approaches, as are implemented in SPM. Further, the non-parametric approach is always valid, given only minimal assumptions.

Because the appropriate permutations of the data labellings is highly dependent on the experimental design, different designs must be treated individually. This is handled within SnPM using a PlugIn architecture for "design modules". Currently, PlugIn modules are available for:

  1. SingleSub: Two Sample T test; 2 conditions, replications
  2. SingleSub: Simple Regression (correlation); single covariate of interest
  3. MultiSub: One Sample T test on diffs/contrasts; 1 condition, 1 scan per subject
  4. MultiSub: Simple Regression (correlation); single covariate of interest, 1 scan per subject
  5. MultiSub: Paired T test; 2 conditions, 1 scan per condition
  6. MultiSub: Randomized Design Paired T test; 2 conditions, replications
  7. MultiSub: Within Subject ANOVA; multiple scans/subject
  8. 2 Groups: Test diff of response; 2 conditions, 1 scan per condition
  9. 2 Groups: Two Sample T test; 1 scan per subject
  10. >2 Groups: Between Group ANOVA; 1 scan per subject
Additional PlugIns will be made available as they are built.

The approach is described in full in Holmes (1994); Holmes (1996) and Nichols & Holmes (2001). (See references below.) These pages give a brief overview of the methodology, and describe the software, it's installation and use.

Statistical nonParametric Mapping refers to the enterprise of making statistical inferences on volumetric statistic images with minimal assumptions using non-parametric statistical techniques. SnPM refers to an implementation of Statistical nonParametric Mapping by Andrew Holmes and Tom Nichols.



Statistical nonParametric Mapping - A quick primer

SnPM uses a permutation test to determine the signifiances of voxels and clusters of supra-threshold voxels. A basic understanding of the permutation test is essential for knowledgeable use of the SnPM toolbox. Fortunately, the basic concept is simple and intuitive: For example, consider a simple two sample problem, with one observation being made on each member of the two groups. If there is really no difference between the two groups, we would be fairly surprised if most of the group one observations were larger than the group two observations. Permutation tests provide a formal mechanism for quantifying this ``surprise'', leading to significance tests.

SPM - assumptions & low df problems...

The parametric approach embodied in SPM uses the General Linear Model to produce a statistic at every voxel, and assesses the resulting statistic image for significant regions using distributional approximations for a continuous random fields with the same marginal distribution and smoothness. This explicitly assumes that the data are derived from strictly stationary homogeneous discrete Gaussian random fields. Further, it is implicitly assumed that the statistic image is sufficiently smooth that it's properties may be approximated by a continuous random field. However t (& F) statistic images with low (denominator) degrees of freedom are very noisy (due to the unreliability of voxel variance estimates from low numbers of observations). These noisy t & F-statistic images have such low estimated smoothness that a continuous random field with the same smoothness would have features at sub-voxel resolution. The result is that these features affect the distribution of the maximal statistic of the continuous field, against which the voxel values of the statistic image are compared for significance, resulting in a conservative test (i.e. significance is under-estimated).

SnPM - a primer...

In contrast to the multitude of assumptions and approximations of the parametric approach, the non-parametric approach exploits the design of the experiment (randomisation test), or makes simple intuitive distributional assumptions, such as symmetry (permutation test). The thinking is simple: If there is really no experimental effect, then the experimental labels, whether A's and B's (for an activation study) or a set of real numbers (for a covariate study), are arbitrary. Any reallocation of the labels to the scans would lead to an equally plausible statistic image. So, considering the statistic images associated with all possible re-labellings of the data, we can derive the distribution of statistic images possible for this data. We can then test our hypothesis of no experimental effect by comparing the statistic for the actual labelling of the experiment with this distribution. Effectively we quantify our surprise at the observed findings on the basis of what we would expect were there no experimental effect! If, out of N possible relabellings the actual labelling gives the rth most extreme statistic, then the p-value is r/N. The details are worked out in the references given below.


SPM makes many strong assumptions about the nature of your data, while SnPM makes a few weak assumptions: SPM assumes that your data, at each voxel, are normally distributed and, across voxels, are derived from continuous random fields with a stationary covariance structure. SnPM assumes that, under the null hypothesis of no experimental effect, you can switch the experimental labels of your data and always expect the same (null) result.

Variance smoothing...

The freedom of SnPM from parametric distributional assumptions allows us to pool variance estimates over neighbouring voxels, under the mild assertion that the true variance image is smooth, giving additional degrees of freedom. The Pseudo-t statistics computed with such a smoothed variance image don't exhibit the noise of low df t-statistic images, This variance smoothing circumvents the low df noisy statistic image problem discussed above, giving the non-parametric approach greater power than it's parametric counterpart.


Understanding the assumptions of SPM requires an understanding of normality, independence and the basics of Gaussian random field theory. Understanding the assumptions of SnPM requires an understanding of exchangability. See the example page for a brief introduction to exchangability and the literature for more detailed discussion. top


SnPM8b - released 7th July 2010

This is the SnPM toolbox for SPM8. While it has been tested in-house, we have received limited feedback from external users and so it is still considered a beta release.


SnPM8b has all the features of SnPM5, but is compatible with SPM8.

Currently SnPM5b uses the sequential type interface of SPM2. We are working to make it use the same hierarchical job manager as SPM8. top


Distribution and installation instructions are given below.

Please report bugs to <snpm-authors at>. 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. See the SnPM3 bugs & fixes section for previously reported bugs and fixes.



SnPM distribution & installation

Quick link! Download is available on Registration page

The SnPM toolbox is a small suite of MatLab functions and M-files that integrate with SPM2 routines. Thus, to use SnPM3 you must have already installed SPM2, and to use SnPM5 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 SPM before using SnPM.

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 SnPM3 bugs & fixes area, and replace older files shipped in the standard distribution.

Note SnPM99, SnPM2 and SnPM5 are still available at the Michigan SnPM web page, though will soon be moved to this Warwick site.

Installation is relatively straightforward. Download the gzipped tar file and unzip it in a location where you want the snpm3 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.)

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

  • The appropriate peer reviewed articles, referred to below.
  • The SnPM manual page, duplicated in the SnPM online help facility.
  • The example page.
  • Basic non-parametric statistical texts, such as Good (1994) & Edgington (1980) will help clarify the underlying concepts of permutation/randomisation testing.


Holmes AP (1994)
Doctor of Philosophy Thesis, University of Glasgow, December 1994.
  • Non-Parametric Analysis of Statistic Images From Functional Mapping Experiments
Holmes AP, Blair RC, Watson JDG, Ford I (1996)
Journal of Cerebral Blood Flow and Metabolism 16:7-22
Nichols TE, Holmes AP (2001)
Human Brain Mapping, 15:1-25.
  • We reply to Halber et al.'s ``Performance of a Randomization Test for Single-Subject 15 O-Water PET Activation Studies'' published in the Journal of Cerebral Blood Flow and Metabolism 171033-1039.
  • Halber et al assert that our non-parametric approach (their implementation of which they dub `Sherlock') is less powerful than a ``standard'' analysis. This conclusion is at variance with our findings, which we consider is simply due to the fact that the ``standard analysis'' they compare to does not strongly control experimentwise Type~I error.
  • Randomization Tests
Edgington ES (1980)
Marcel Dekker, New York & Basel
  • Permutation tests: A practical guide to resampling methods for testing hypotheses
Good P (1994)
Springer-Verlag, New York top



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

General SnPM 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 SnPM authors may be contacted at <snpm-authors 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


SnPM8: Bugs & Fixes

This section describes the bugs that have been reported, along with the appropriate fixes. Updated versions of appropriate SnPM functions are available from the snpm8_updates page:

None found yet! top


SnPM5: Bugs & Fixes

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



snpm_ui.m v4.19

Synopsis: A variable is not defined; also, F-contrasts cause error "CAT arguments dimensions are not consistent".

Fix: Merge of two bug fixes, from 07/01/13 and 08/11/07.

Thanks: Thanks to Shary and Satoru Hayasaka for reporting the first problem, Ken Rando for the latter one.

Download: snpm_ui.m.

-Tom 08/11/07

snpm_cp.m v1.2

Synopsis: change based on the update of snpm_STcalc.m and record suprathreshold statistics.

Download: snpm_cp.m.

-Hui 07/06/23

snpm_pp.m v1.3

Synopsis: some minor changes to improve the display

Thanks: Thanks to Darren Gitelman, Department of Neurology, Northwestern University for those changes.

Download: snpm_pp.m.

-Hui 08/01/10

snpm_STcalc.m v1.3

Synopsis: changes to avoid double calculations or indexing in for loop. Speeds calculation.

Thanks: Thanks to Darren Gitelman, Department of Neurology, Northwestern University for those changes.

Download: snpm_STcalc.m.

-Hui 08/01/10

snpm_mip.m v1.1

Synopsis: Add snpm_mip.m in SnPM5 toolbox based on updates of SPM5. In addition, we also update snpm_pp.m and snpm_combo_pp.m because of the change. The users can download them from this link.

Download: snpm_mip.m.

-Hui 07/07/12

snpm_combo_pp.m v1.2

Synopsis: pre-allocate CIinfo matrix

Thanks: Thanks to Darren Gitelman, Department of Neurology, Northwestern University for those changes.

Download: snpm_combo_ppc.m.

-Hui 08/01/10 top


SnPM3: Bugs & Fixes

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



snpm_defaults.m v4.4: Decreased nMax4DefVol to 9.

Synopsis: The maximum number of scans for which volumetric mode is default is set in spm_defaults, nMax4DefVol. Previously this was set to 16, but some very large anatomical datasets will crash even with such small sample sizes.

Fix: This variable has been now set to 9, so for any analysis with 9 or more scans, you will now be prompted to use "Volumetric" or planar mode.

Thanks: Thanks to Satoru Hayasaka for reporting this problem.

Download: snpm_defaults.m.

-Tom 06/04/27


Additional Plugins

There are no additional plugins at this time top



We are indebted to everyone who has tried the software and reported bugs. Special thanks goes to Jun Ding, University of Michigan Biostatistics, for work on the new SnPM3 version. We also would like to thank Yanjun Xu of the Mental Health Research Institute, University of Michigan; Yanjun did important work on porting SnPM96 to Matlab 5. top



Contact Info

Room D0.03
Deptment of Statistics
University of Warwick
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