By members and collaborators of the Functional Imaging Laboratory

Statistical Parametric Mapping 99

SPM'99 - released 25th January 2000

SPM99 is very old now. Consider using SPM12. If you really want SPM99, then:

The software is available for download, 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 URL. You should also periodically check the SPM99 bugs & fixes area.

There was no upgrade path from SPM99b (the beta release) to the full SPM99 release. This was due to the number of files that were updated during the beta testing phase (mainly due to the implementation of the batch system.) You must register for and download the entire SPM99 package.


Although SPM99 still uses the Analyze file format, and will therefore read image files from previous versions of SPM, there are differences in the algorithms, templates and models used in SPM99 over previous releases. Therefore, we recommend you use a single SPM version for any given project.

SPM99: Bugs & Fixes

Although we have tried hard to produce high quality software, in a project of this size and complexity there are certainly some remaining bugs. Please assist us by reporting bugs to: <spm@fil.ion.ucl.ac.uk>. Peculiarities, feedback, and general queries on the use and theory of the software should be raised on the Email list.

Bugs and fixes will be posted on the list, and described in the README.txt file in the SPM99_updates anonymous download area, at http://www.fil.ion.ucl.ac.uk/spm/download/spm99_updates, from where updated programs can be downloaded. Note that SPM99 is now very old, so the authors enthusiasm for fixing bugs and making it compatible with more recent MATLAB versions is virtually nill.

Availability & licencing

SPM is made freely available to the [neuro]imaging community, to promote collaboration and a common analysis scheme across laboratories. The software represents the implementation of the theoretical concepts of Statistical Parametric Mapping in a complete analysis package.

SPM (being the collection of files given in the manifest in the Contents.m file included with each distribution) is free but copyright software, distributed under the terms of the GNU General Public Licence as published by the Free Software Foundation (either version 2, as given in file spm_LICENCE.man, or at your option, any later version). Further details on "copyleft" can be found at http://www.gnu.org/copyleft/. In particular, SPM is supplied as is. No formal support or maintenance is provided or implied.

The authors are research scientists in the fields of neuroscience, statistics and image processing; for whom SPM is the vehicle for implementation and dissemination of ideas. We aren't software engineers, and (unfortunately) don't have the resources to formally support SPM. The SPM Email list <spm@jiscmail.ac.uk> provides an informal forum for discussion of technical and theoretical SPM issues, and is monitored by the authors. We ask that you read the SPM documentation, review past discussion on the email list, and exhaust your local avenues of SPM expertise before contacting us, either directly or via the SPM discussion list.


The SPM software is a suite of MATLAB functions, scripts and data files, with some externally compiled C routines, implementing Statistical Parametric Mapping.

In brief, you need the following to run SPM:

  1. A UNIX, Linux or Windows95/98/NT workstation
  2. MATLAB 5.2.1 or greater
  3. An ANSII C-compiler (for platforms other than the core supported platforms of Sun Solaris2, Linux & Windows95/98/NT).
  4. A program to convert your images into ANALYZE format
  5. Access to the internet: For software downloads, SPMweb, and the email discussion list.
  6. Plenty of time...

Additional considerations are given below:

  • The current version of SPM was primarily developed and tested on 200MHz UltraSPARC 2 workstations (128Mb RAM, 200Mb swap) under Solaris2.5.1 (OpenWindows3.5.1) using MATLAB version 5.2.1., and with access to roughly a terabyte of file-storage! Some development has also been undertaken on Linux and WindowsNT platforms.
  • MATLAB is produced by The MathWorks, Inc. Natick, MA, USA. http://www.mathworks.com/. SPM requires only core MATLAB to run (no special toolboxes are required).
  • SPM99 has been successfully installed on Sun (Solaris2.5.1), SGI (Irix ??), Linux (??) & Windows 95/98/NT
  • Although SPM is written for a relatively small memory footprint of 128Mb RAM, it works better with 256-512Mb.
  • Neuroimaging data sets are very large, so fast access to a large filestore is essential.
  • MatLab 5.2.1 or greater: MatLab is a high level numerical mathematics environment optimised for operations on untyped matricies. It's syntax is close to that of matrix algebra, making the code an effective pseudo-code for the algorithms, and leading to fast development times. SPM99 is written for MatLab 5.2.1, and will not work with MaLab 5.1 or earlier.
  • Whilst the majority of the code is implemented as MatLab M-files & functions containing standard MatLab commands, a number of features specific to the UNIX version have been used. SPM also uses external C programs, linked to MatLab as C-mex files, to perform some of the more computationally intensive operations. Some of these latter C programs use direct system calls to implement SPMs "memory mapping", mapping disk resident image volumes into memory. (Specifically, the calls are mmap (mman.h) in spm_map_vol.c; munmap (mman.h) in spm_unmap_vol.c; & readdir (dirent.h) in spm_list_files.c. Not all operating systems support mman.h.)
  • Pre-compiled binaries are provided with the distribution for Solaris2 (*.mexsol), Linux (*.mexlx), and Windows (*.dll). For these platforms you only need MATLAB.
  • For other UNIX platforms, you will need an ANSII C compiler to compile and link the external c-mex files. A makefile spm_MAKE.sh is provided with the distribution, configured for various platforms. If you have to tweak the makefile to compile the SPM mex-files for your platform, please send us the details so we can include them in the distributed makefile. Additionally, if you send us the compiled binaries, we would be happy to host archives of compiled mex-files in the user contributions area, for other users benefit.
  • Porting of the C-mex files to Windows was acheived by Matthew Brett, using the free Cygwin UNIX development environment for Windows. Details of installing configuring CygWin and MATLAB for compiling mex files using EGCS gcc are given by Matthew on the Cambridge Imagers web site at http://gnumex.sourceforge.net/. Note that since we supply ready compiled *.dll's, you don't need to do this to use SPM!
  • SPM uses the simple header and flat binary image file format of ANALYZE-7 (Mayo Clinic, Rochester, USA.) http://www.mayo.edu/bir/), with slight customisations to the header. See "Data Format" in the online help [spm_format.man in the distribution], or "Image format" below. SPM can also read MINC & ECAT-7 images.
  • You will either need to convert your image files to one of these formats (preferably Analyze), or construct an additional module for the SPM memory mapping subsystem to read your file format. Image conversion utilities for your image file format may be available in other packages, or may have been specially written by other SPM users. (Consult the SPM email discussion list, described below, by first searching the archives, and posting a query if necessary.) Unfortunately we have no resources to provide image conversion software, although we will collaborate in developing SPM memory mapping read-modules for popular image formats for inclusion in SPM.

Getting started

Before attempting to analyze data using SPM, we recommend you spend some time reading. It is essential to understand the concepts of Statistical Parametric Mapping in order to effectively use the software as a research tool. You should begin with these web pages, particularly the "Documentation" page.

There is no manual for the SPM package. Having familiarised yourself with the concepts, you should familiarise yourself with the package by a thorough review of the on-line help system. SPM is launched from within MatLab by typing spm at the MatLab prompt. (If the spm.m fuction is not found, make sure the SPM distribution is on your MATLABPATH. Type path at the MatLab prompt to display the current path.) A splash screen is displayed, welcoming you. Press the "About SPM" button to launch the help facility. The initial help screen describes features of the current version. Press the "Menu" button at the top of the help screen to display a representation of the SPM menu window. Pressing the buttons on this representation leads to appropriate help topics. Press "Help" for information on using the help facility.

To start SPM proper, press "Exit" in the help window to return to the spash screen, and select PET/SPECT or fMRI as appropriate. The three SPM windows will be drawn, a menu window, a blank window for interaction, and a results window. This interface remains constant throughout the SPM session. Begin by displaying images using the "Display" feature.

SPM uses (only) Analyze format images. This format is discussed below. You'll need to convert the images from your scanner to this format. We cannot supply any conversion programs. (Ours are tailored to our sites scanning protocols and network setup, and we are limited by confidentiality agreements.)

Most people learn how to use SPM from a friend. If you're starting from scratch, then it might be worth using the SPM email discussion list to contact fellow SPM'ers in your locality.

Image formats

Derived from spm_format.man v1.2. Check the spm_format.man in your distribution.

SPM has been written to deal with two or three dimensional data of any size (either image dimensions or voxel size). The data however should be organized with a separate file for each scan, comprising transverse slices running from the bottom to the top of the brain.

Specifically, SPM uses the simple header and flat binary image file format of ANALYZE-7 (Mayo Clinic, Rochester, USA.) http://www.mayo.edu/bir/), with slight customisations to the header. (It can also read MINC & ECAT-7 images.)

More specifically: (and see http://www.mayo.edu/bir/PDF/ANALYZE75.pdf)

The image file

*.img: An uninterrupted array of (unsigned integer, signed short, signed integer, float or double) voxel values. Each *.img usually has an associated header file that contains information about the image process in question.

The original images which SPM uses can be in any orientation. However, after spatial normalisation, the images must be in the following orientation:

X increases from Left to Right
Y increases from Posterior to Anterior
Z increases from Inferior to Superior

This is a right handed coordinate system, and is consistent with the Talairach atlas.

In order to sucessfully spatially normalise the images, SPM'96 must be able to determine the initial orientation of the images. The global variable "sptl_Ornt" contains this orientation. This is initially set from the file "spm_defaults.m" . This can however be changed from within SPM'96 (for the duration of the SPM session) using the `Defaults' button. As a result of this, left-right (radiological v neurological) orientations are no longer prompted for in the statistics module of SPM.

The header file

*.hdr: The format of the 348 byte header file is that adopted by ANALYZE (The Mayo Clinic, Rochester USA, http://www.mayo.edu/bir/). The fields that are necessary in the context of SPM include information about:

Field & [SPM global variable]
  • image size {in voxels for x, y and z}
  • voxel size {in mm for x, y and z}
  • data type
    [TYPE] Derived from spm_type.m v1.1
    0 0-- DT_NONE -
    1 1-uint1 DT_BINARY -
    2 81uint8 DT_UNSIGNED_CHAR(unsigned char)
    4162int16 DT_SIGNED_SHORT (short)
    8324int32 DT_SIGNED_INT (int)
    16324float DT_FLOAT (float)
    64648doubleDT_DOUBLE (double)

  • a scaling coefficient {applied during memory mapping}
  • [SCALE]
  • offset of voxel values in *.img {in bytes}
  • [OFFSET]
  • the origin {in voxels for x, y and z} {e.g. the anterior commissure}
  • [ORIGIN]
  • description {a short string}
  • If *.hdr does not exist then default values are assumed. Default values can be changed by selecting 'defaults'. *.hdr can be created (and can be edited) using the 'Display' facility, or manually using spm_hwrite.m

    The 'Display' facility also includes a 'Fix header' module that allows multiple header files to be created and ammended interactively. It is important that these header files are correct. The most common problems with using SPM usually reduce to incomplete or incorrect header files.

    The `*.mat' file

    This simply contains a 4x4 affine transformation matrix in a variable `M'. These files are normally generated by the `realignment' and `coregistration' modules. What these matrixes contain is a mapping from the voxel coordinates (x0,y0,z0) (where the first voxel is at coordinate (1,1,1)), to coordinates in millimeters (x1,y1,z1). By default, the the new coordinate system is derived from the `origin' and `vox' fields of the image header.

    x1 = M(1,1)*x0 + M(1,2)*y0 + M(1,3)*z0 + M(1,4)
    y1 = M(2,1)*x0 + M(2,2)*y0 + M(2,3)*z0 + M(2,4)
    z1 = M(3,1)*x0 + M(3,2)*y0 + M(3,3)*z0 + M(3,4)

    Assuming that image1 has a transformation matrix M1, and image2 has a transformation matrix M2, the mapping from image1 to image2 is: M2\M1 (ie. from the coordinate system of image1 into millimeters, followed by a mapping from millimeters into the space of image2).

    These `.mat' files allow several realignment or coregistration steps to be combined into a single operation (without the necessity of resampling the images several times). The `.mat' files are also used by the spatial normalisation module.

    Components of the software

    SPM is a collection of files that are used by MatLab. These files include:

    spm_*.m files
    ASCII files that form the main structure for SPM. Most of SPM is written as MatLab functions. These are compiled at their first invocation in a MatLab session, and the compiled versions are cached in memory for subsequent use. This results in a slight delay in the startup of some routines. MatLab script files (or M-files) are occasionally used. These are interpreted by MatLab, but have the advantage of working in the base MatLab workspace, such that their results are available to the user after completion.
    Clearly MatLab is slower than writing everything in fully optimised C; however the fundamental advantage of having a didactic pseudo-code specification of this sort is preferred over implementational efficacy. Further, MatLab is optimised for matrix and vector operations, which are utilised whenever possible.
    ASCII containing C source code linked to MatLab. These are complied in a Matlab-specific fashion to produce Mex-file programs that can be called directly from Matlab. Once compiled these routines are suffixed in a platform dependant fashion (e.g. spm_*.mex4, spm_*.mexsol). These routines implement memory mapping and numerical operations that are called frequently. Precompiled Mex files are provided for Solaris2.x, a Makefile (spm_MAKE) is included for other platforms.
    ASCII files containing SPM manual pages. These can be accessed through SPMs graphical help system or in the MatLab command window using the MatLab help command. See "Documentation" for further details.
    Files with a Matlab specific header structure that can be loaded directly into Matlab. These files contain images and other data in matrix format, usually in double precision (see Matlab Users' Guide).

    Where possible the user interface and computational or analytical aspects of the software have been segregated such that spm_*_ui.m sets up the user interface and assembles the appropriate input arguments for spm_*.m. The spm_*.m contain the statistical and mathematical implementation of a generic nature, and would be of greater interest to those who wish to incorporate SPM into an existing package.

    New features

    This section describes features of SPM'99, and is derived from spm.man v2.5, included in the distribution.



    • support for re-orienting images via their ".mat" files
    • Realign
      • handles multiple fMRI sessions
      • two pass procedure for PET realignment (images registered to mean)
      • checks for stopping criterion
      • Fourier interpolation (for data with isotropic voxels)
      • algorithm generally improved
      • saves realignment parameters for use as confounds to stats
    • Segment
      • simultaneous nonuniformity correction
      • fixed problem with prior probability images
    • Coregister
      • "tweaked" for slightly better results
      • extended for other modalities
      • optional mutual information registration
    • Normalize
      • affine part made more stable by using a MAP scheme
      • improved regularization for nonlinear part
      • optional weighting so that out of brain structures don't contribute
      • new templates
    • Slice timing
      • temporal resampling of fMRI time series
      • to correct differences in slice timing of 2D acquisitions
    • Enhanced cortical surface extraction for rendering

    Volume I/O:

    • copes with byte-swapped Analyze format data
    • re-working of memory mapping to overcome 2 or 4 Gbyte datasize limit
    • modular image mapping code - support for reading CTI & MINC data


    • Completely re-structured & re-written statistics section
    • split into three stages: setup, estimation, and assessment (results)
      • setup saves an SPMcfg.mat file which can be run in batch mode
      • fMRI models can be re-used: Design information saved in SPM-fMRIDesMtx.mat
    • estimation stage can be run in batch mode
    • enhanced event related fMRI modelling
    • band-pass filtering for fMRI time series
    • intrinsic temporal autocorrelation estimation
    • enhanced PET models
      • subject separable ready for random effects
      • time order entry of images in PET/SPECT & basic stats
      • enter all scans for a subject, indicate conditions by "abababa"...
      • design matrix shows actual experimental design
      • easier enterng of covariates (don't have to reorder)
      • customisable via documented "design definition structure"
    • new "basic stats designs" - t-tests, Anova, regression & co
    • implicit masking: Dummy value for out-of-brain voxels (0 or NaN)
    • explicit masking: mask images
    • absolute & proportional threshold masking
    • user-defined globals (for clinical applications)
    • supports masked data, explicit masks, and negative data
    • efficient handling of design spaces via space structures (JBP)
    • statistics results files are plain image files
      • parameter estimates, variance estimates, contrasts and SPM's
      • mask images, showing exactly the volume analyzed
    • integrated random effects for balanced designs, via multi-level analyses
    • contrasts entered after estimation (in the results section)
    • new "contrast manager": contrast naming and validity checking
    • "F-contrasts" (JBP) to specify F-tests (& hence two-sided T-tests)
      • flexible specification of general linear hypotheses
      • model comparison
      • efficiently computed from projections of parameter estimates
    • inference directly on t & F fields
      • no "Gaussianisation" of statistic images
      • tabular summaries give equivalent Z-values
    • small volume corrections (Keith Worsleys' unified theory)
    • new conjunctions formulation (as minimum field) - with K Worsley
    • contrast orthogonalisation for conjunctions
    • inclusive & exclusive masking (allowing old-style conjunctions)
    • no "F-thresholding" of results saved for analysis
      • results available at all voxels within
      • only of voxels whose data is saved for plotting
    • raw data saved at F-significant voxels in compressed format for plotting
      • much smaller stats files than old "XA.mat" files
    • integrated interactive results, contrast and design interrogation section
    • "surfable" design matrices
    • clearer tabular output of p-values and statistics
      • active table - click to extract data or jump to location
      • ASCII text output of p-value & statistics table
    • enhanced plotting routines, particularly for event-related fMRI
    • ...bags of other stuff... (I can't remember what SPM96 did!)

    New utilities:

    • enhanced image algebra (ImCalc)
    • powerful command -line options
    • improved display facility - *.mat file sensitive
    • CheckReg - clickable ortho projections of two images side by side
    • improved rendering facility with cortical surface extraction utility
    • brain extraction routine
    • file and directory management from the GUI

    Enhanced GUI & command line use

    • range checking of input
    • context menus (right mouse button)
    • command line input has access to base workspace
    • assisted input of parameters from ASCII files
    • neater "crashing out" of GUI i/o
      • just press "Clear", or use "crash out" ContextMenus
    • timestamping in command window
    • dynamic progress reporting in command window
    • more robust GUI / no-GUI handling
    • additional input dialogs
    • full command line support for question answering
      • except results section, which is GUI orientated
    • context help and ToolTips
    • alerts & dialogs
    • ToolTips
    • context help for most functions
    • enhanced graphics editing in SPM graphics window
    • neater window handling

    Re-written for Matlab version 5 (5.2 or greater required)

    • no additional toolboxes required
    • simplified structure
    • better documented interfacces and file formats
    • numerous i/o, file & GUI handling primitives
    • comprehensive statistical distribution functions

    Cross platform support

    • Solaris, Linux & WindowsNT supported "out of the box"
      ( *.mexsol, *.mexlx & *.dll's provided)
    • makefile supports many other UNIX platforms


    File formats & memory mapping

    The functions for reading and writing images have changed. All writing of images is via the functions spm_create_vol and spm_write_plane (even mex routines now call these functions).

    A handle for an image volume is now via the "spm_vol" function:

    	V   = spm_vol('filename.img'); 

    The structure "V" is a structure or a matrix/cell-array of structures taking a similar form to the matrix/cell-array of strings that define the image file names. The form of each element of V is described in spm_vol.m. Sampling the image still involves passing the handle to spm_slice_vol, or spm_sample_vol. Because of the limitation on the amount of virtual memory allowed for a process (either 2 or 4 Gbytes, depending on the OS), the actual mapping is done as the data is required, and not at the spm_vol stage. Because mapping is done on the fly (from the image filename stored in the handle structure), handles from spm_vol.m can be saved and used across Matlab sessions (provided the files haven't moved).

    A number of new data types are supported, including signed and unsigned versions of existing types, and also byte-swapped versions. Also, the volume no longer needs to be contiguous, and each slice can have different scalefactor and offset, so formats such as ECAT 6 could in theory be supported.

    Byte-swapped Analyze files can now be read, so mixing different computer architectures on the same network should be less of a problem.

    ECAT 7 files can now be read, providing that they only contain a single frame (matrix number 1010001). Some MINC files can also be read, although I'm not sure about all the different possible ways of representing images in the MINC format. I'm not 100% sure about the MINC stuff, so it may be worth checking this out properly. Full support for many other formats could be added by modifying: spm_vol.m, spm_get_space.m, spm_create_vol.m and spm_write_plane.m.



    A number of modifications have been made to the realignment module. Many of these reflect the questions asked on the SPM discussion list. The realignment can be thought of as three components: parameter estimation, image resampling and correction of motion artifacts (adjustment).

    fMRI sessions are now handled differently, because of the assumption that there may be systematic differences between the images in different sessions. The first volume of each session is now aligned to the first volume of the first session. Subsequent volumes in each session are then aligned to the first volume of the session. This should acheive increased accuracy within session, since all the images are aligned to an image from the same session. This also saves time, because subject movement between sessions tends to be larger than subject movement within session. The large systematic differences between sessions are therefore removed in the first realignment step. Adjustment is performed separately for each session, but the same mask for writing the realigned images is used for all images of all sessions.

    PET realignment is now a two pass procedure. The first pass aligns all the images to the first image in the series. A mean of the realigned images is created, and the second pass aligns all the images to the mean. The second pass effectively matches the images to a less noisy template, and so should result in more accurate movement estimates.

    Previously, the estimates of motion continued for a fixed number of iterations. This may be OK for small movements, but was inadequate for large ones. The realignment now continues until a stopping criterion has been achieved.

    Movement estimation begins by using (faster but less accurate) tri-linear interpolation to resample the data. The final iterations are done using sinc interpolation in order to obtain the final high accuracy.

    The algorithm for the SPM96 motion correction was very similar to that of the previous version (SPM94). However, both these implementations included an assumption about the rate of change of sum of squared difference with respect to parameter changes that only held when the rotations were small. This has been fixed.

    Occasionally it may be necessary to attempt to sample voxels that lie outside the field of view of the original image. The parameter estimates in the SPM96 implementation assumed that the values of such voxels should be zero. In SPM99, these voxels are excluded from the computation of motion estimates.

    The sinc interpolation has changed. In the previous version, the width of the hanning window was 1 pixel narrower than the optimal width. This has been fixed. Also, the integral under the sinc kernal has been set to one (by a renormalizing step). Both odd and even numbers of neighbours can now be used by the interpolation. Windowed sinc interpolation schemes are acheived by passing a negative hold to functions such as spm_sample_vol. Positive holds will result in polynomial (Lagrange) interpolation being used, whereas negative holds use sinc interpolation. The gradient of the images can also be directly obtained by spm_sample_vol.

    A three dimensional Fourier interpolation has been implemented that is based on the paper by Eddy et al. This method is used for resampling fMRI data, but it requires the voxel sizes of the images to all be isotropic (since zooming can not be performed using this method). Preliminary tests showed that this method did not greatly reduce the resampling errors.

    The fMRI adjustment has been modified.
    Rather than removing signal that is correlated to functions of the six parameters describing the rigid body movement of the subject, the adjustment now uses functions that are dependant upon the displacement of each voxel. This requires three parameters to describe it rather than six, but it is now a different function for each voxel. The functions that are covaried from the data are periodic in terms of the number of voxels displaced, and are based upon sines and cosines of the number of voxels displaced. e.g., the functions for a displacement of two voxels are identical to the functions for a displacement of one voxel. The functions were appropriate for simulated data, and with phantom data that was "moved" by moving the field of view of the scanner. However, the method is not quite so good for real subject movement within the scanner.

    The adjustment step is now regularized. This regularization is based upon Bayesian statistics which states that:

    	p(a|b) \propto p(b|a) \times p(a) 

    If (a) is the coefficients of the regressors, and (b) is the data, we wish to find the suitable values for (a) which maximize the posteriori probability of (a) given (b). Taking the Gibb's transform of these functions gives us:

     	H(a|b) = H(b|a) + H(a) + c  

    which expresses the Bayesian furmulation in terms of energy cost functions. The objective is now to find the coefficients that minimize the cost function. The model assumes that the errors on (b) are normally distributed, and that H(b|a) is proportional to the residual sum of squares between the data and the fitted function. Probability distributions for H(a) are estimated by translating the first image of the series by different amounts, using the windowed sinc function, and Fourier interpolation. This allows an estimate to be made for the a priori distribution of the errors.

    Slice timing

    A button has been added for correcting fMRI time series data for the differences in image acquisition time between slices. It is based on ACQCORRECT by Mark D'Exposito, Geof Aquirre and Eric Zarahn at U. Penn which was modified (to NMH_ACQCORRECT) by Darren Gitelman at Northwestern U and in turn modified by Rick Henson and Christian Buechel and John Ashburner at the FIL.

    Note that there is nothing at all spatial about this procedure! It is included here because it is an optional pre-processing step that should improve results - especially for event related studies.


    An error with the a priori probability images has been fixed (see Problem with Templates and Probability Images).

    Segmentation now includes a bias correction, but extensive evaluation of this has not been performed. The theory for the bias correction was described by a poster at HBM'98: J. Ashburner and K. J. Friston (1998). "MRI Sensitivity Correction and Tissue Classification". NeuroImage 7(4):S107. The basic partitioning algorithm is described in: Ashburner and Friston (1997), NeuroImage 6(3):209-217.


    Inter-modality registration is normally a three step procedure. The first step involves simultaneous constrained affine registration of the images to a template. The affine registration in this step is now more stable because it has been regularized as described in: J. Ashburner, P. Neelin, D. L. Collins, A. C. Evans and K. J. Friston (1997). "Incorporating Prior Knowledge into Image Registration". NeuroImage 6:344-352. New templates have been developed for this stage, including an EPI template for T2* fMRI. The new templates are described in templates.man.

    The second step is segmentation, which has been improved by having more correct images of prior probability. Other tweeks have also been done in order to improve the results slightly. For example, better PET/MR registration is possible when the CSF partition is not used. The method is described and evaluated on a small dataset in: J. Ashburner and K. J. Friston (1997). "Multimodal Image Coregistration and Partitioning - a Unified Framework". NeuroImage 6(3):209-217


    The estimation of spatial normalization parameters consists of two parts: affine registration and basis function registration. The affine registration has been made more robust by placing it within a Bayesian framework. Zooms and shears from a large number of different brains provide knowledge of the a priori variability of brain sizes. The full method is described in: J. Ashburner, P. Neelin, D. L. Collins, A. C. Evans and K. J. Friston (1997). "Incorporating Prior Knowledge into Image Registration". NeuroImage 6:344-352.

    The basis function registration is now more stable. Part of the problem was because of edge effects due to the smoothing (because values outside the FOV are unknown). Voxels less than 8mm from the edge are now used in the intensity matching. The regularization has been increased in order to improve stability. Improved estimates of the likelihood potential have been made by considering the image smoothness when estimating the degrees of freedom. A bug was found in SPM96 in the computation of the rate of change of the cost function with respect to changes in the parameters. This occured because the gradient computation was based on the gradient computation code from SPM95 (which was also slightly wrong). It has subsequently been fixed.

    In principle, the spatial normalization can fit an image to a linear combination of templates. This didn't work in SPM96, but has now been fixed. An error with the templates has also been remedied (see Problem with Templates and Probability Images).

    Weighting images can now be used to mask out regions of the images not to be included in the computations. Use of a weighting image to mask out the effects of scalp is described briefly in: J. Ashburner, C. Hutton, R.S.J. Frackowiak, I. Johnsrude, C. Price and K. J. Friston (1998). "Identifying Global Anatomical Differences: Deformation-Based Morphometry". Human Brain Mapping 6(5):348-357 A weighting image can also be used to mask out strokes, tumours etc.

    Graphical display of spatially normalized images is improved - (see Check Reg)

    New templates for spatial normalization are included with this release.

    The basis function spatial normalization is described in: J. Ashburner and K. J. Friston (submitted). "Nonlinear Spatial Normalization using Basis Functions". Human Brain Mapping

    Brain Extraction

    A utility has been added that will take grey and white matter segments (from Segment) and clean them up to produce an extracted brain. This will also produce optional rendering images that can be used by the Render button.


    Rendering can now display up to three sets of blobs. Each pattern of blobs is displayed in red, green or blue in a semi-transparent brain. The intensity of voxels inside brain decays exponentially with distance. Extra pre-defined rendering images have been included. There is a higher resolution image of a single subject brain, and also a smooth average brain surface (which I prefer because it is not as misleading). Other brain surfaces can also be used (see Brain Extraction) below.

    Check Reg

    Allows orthogonal sections through any pair of registered images to be displayed. Clicking anywhere in one of the images shifts the centre of the orthogonal sections (see Display). Intended for checking registration and spatial normalization results.


    The display utility has been re-written to be an interactive orthogonal image viewer (see Check Reg). It allows images to be viewed in different orientations and to be re-oriented via their ".mat" files. The images can be zoomed and visualized using different interpolation methods. Translucent activation blobs can be superimposed in different colours on the displayed image.

    Problem with Templates and Probability Images

    A problem was identified in the conversion of the original MINC files to Analyze format. When the files were converted, we did not realize that all planes in the volumes were scaled to their own maximum values. The affected files were:

    • templates/T1.img
    • canonical/avg305T1.img
    • canonical/T1.img
    • apriori/gray.img
    • apriori/white.img
    • apriori/csf.img

    The error has been remedied. Also, new gray, white and csf images have been obtained from Montreal that are based upon 151 subjects (see templates.man). New template images are now included that are mostly based on 152 brain averages (see spm_templates.man).


    In construction...