PetStatistics - MRC CBU Imaging Wiki

Please enter your password of your account at the remote wiki below.
/!\ You should trust both wikis because the password could be read by the particular administrators.

Clear message
location: PetStatistics

STANDARD STATISTICAL PET ANALYSIS in SPM99

  1. This page describes a standard statistical analysis of activation PET data (locally from the WBIC). It assumes a directory structure that is standard for WBIC data, with the PET activation files in a directory:

[some directory] / [subject number] /p00/00/spm/
  • where [some directory] is some directory holding the data for one or more subjects, and [subject number] is a WBIC subject number. The PET activation images are called "emiss_0xx_tra.img" where "xx" is the scan number in the series, usually from 00 to 11.


  1. In an Xterm (or equivalent) window, move to the directory that you want to run your analysis from. (If you are having trouble moving around a Unix environment, go to the help with unix page ). It is a very good idea to create a new directory for each analysis you do. This is because SPM stores the results of each analysis in the directory you started SPM from (n.b. SPM has an option for you to change your working directory from within the SPM environment - go to "utils" in the bottom panel of the upper left window and choose "CD"). So if you start SPM from a directory with existing analysis files, and you do not change directory, it will overwrite them with the files of your new analysis. It does warn you before it does this, however.

    (For information on how to automate some of the analysis steps in SPM99b, see automating condition and covariates input )

    Run SPM 99. Choose "PET and SPECT" version.

    In the middle panel of the top left-hand window, choose "PET/SPECT models."


  1. You will then be asked in the bottom left window: "Choose design type."

    • If there is only one subject, then you want to do a "single subject..." design.

    • If there is more than one subject, then you should usually choose "multi-subj... ".

    • If you are not concerned about your conditions, but only want to examine your scans with respect to one or more covariates, then pick "...covariates only."

    • Otherwise, if you are interested in comparing conditions, with or without covariates, then you should pick "...conditions and covariates."

    • Sometimes you will need more complex designs, with different groups etc; these designs are not covered here.

    This guide will assume that you have chosen "multi-subj: conditions and covariates" since that is the most common form of analysis. The format is virtually the same for each design type, though.

    (N.B. The data will probably be less noisy, and more accurate, if you covary out time and movement drift for the scans in the order they were given to each subject - see controlling for scan order and subject movement ).


  1. For "# of subjects" put in the number of subjects that you want to analyse.

  2. The SPMget dialog box will then open, asking you to choose the scans for the first subject. Either type in the precise address for the directory of the .../p00/00/spm/snemiss files for the first subject in the blue slot at the top of this dialog box, or use the buttons surrounding this box to find the address ("Pwd" moves you to the current working directory, "Home" moves you to the home directory you have on unix, "Previous Directories" provides a list of previous directories chosen in this session as well as any default directories, and "Subdirectories" shows you the directories within the current directory chosen), or navigate using the mouse in the main files list box (with the red names) by choosing ".." to move up one directory and clicking once on a directory name to enter into that directory. To the right of the "Filter:" button, there is another blue box. It will initially say "*.img" Once you are in the right directory for the first subject, change the wording of this blue box to "sn*.img" ("s" stands for "smoothed" and "n" stands for "normalised" - two preprocessing terms - see the preprocessing page for more details). In the main box below, only the 12 (or 6 or whatever) scans of subject 1 will be presented, each in the form of "snemiss_0**_tra.img" (assuming they are from the WBIC). Click on the scans you are interested in analysing (if you are interested in all scans, simply press "all" in this dialog box). It is standard practise (and much simpler) if you choose the scans in scan order, since the scan order you choose has to be the same for condition input (as well as covariates input and time and movement effects input - if you also include these). For the WBIC, remember that these scan numbers start at 000, rather than 1. Once all subject one scans have been highlighted, press "Done" (if you analysis is "covariates only" press here to move the next relevant section). You will then be prompted (in the bottom left window) for a list of condition numbers (separated by a space) equal in number to the number of scans you have just chosen. The first number assigns a condition to the first scan for this subject, the second number assigns a condition to the second scan chosen for this subject, etc. In addition, these numbers must apply to the same condition for each subject. As an example:

    • Condition 1 = Language
    • Condition 2 = Memory
    • Condition 3 = Motor
    • Condition 4 = Control
    • Subject 1 Scans chosen in order: snemiss_000.img snemiss_001.img ..2 ..3 ..4 ..5 ..6 ..7 ..8 ..9 ..10 ..11

    • Subject 1 Conditions: 1 2 3 4 2 4 3 1 4 3 1 2

    • Subject 2 Scans chosen in order: snemiss_000.img ..1 ..2 ..3 ..4 ..5 ..6 ..7 ..8 ..9 ..10 ..11

    • Subject 2 Conditions: 4 3 2 1 3 1 2 4 1 2 4 3

    So from this subject 1 scan 3 is a motor condition, while subject 2 scan three is a memory condition. It is a good tip to write down the condition numbers for each subject (corresponding to the order you intend to choose the numbers - usually scan order) before you begin your analysis. Once the condition list has been given for subject one, the same process needs to be repeated for subject two, etc. etc.. If your scans are roughly in the same place on the server, it might be easiest to change the subject number in the blue slot at the top to the new subject number, and press enter, to see all the snemiss*.img scans in the right place for the next subject. Repeat all these procedures until all conditions for all subjects have been chosen.


  1. here ). For each covariate, either provide a list of numbers, where the first number is the covariate that corresponds to the first subject's first scan and the last number is the covariate that corresponds to the last subject's last scan, or load a covariates text file (for information on how to do this, see automating covariates input ). Once the covariate has been entered into SPM, you will be invited to give the covariate a name. Then you will be asked "covariate: interaction?..." Here, we imagine that you only want to enter the covariates into the analysis in the simplest possible form. So, choose the default of "none.", and when you are asked "Covariate: centred?..." Choose "no centering." Repeat the above process for each covariate of interest that you want to include.

    You will then be asked for "#nuisance variables." This is the place where you enter the time and movement files, to covary out scan and movement effects in your data (see the page on time and movement effects for more details). If you are doing this, then you will normally enter two, one for the scan order effect and one for the set of movement effects. If there are any other covariances of no interest that you want to include as well, then increase the number of nuiscance variables accordingly, and then input these as covariates here in the same way as you would covariates of interest.


  1. The next input asks for"GloNorm: select global normalisation..." Choose: "AnCova {subject specific}.". For some explanation of the different types of global normalisation, as well as grand mean scaling (below), see the SPM statistics tutorial and associated matlab script.

  2. You will then be asked to choose: "GMsca: Grand Mean Scaling..." Pick "Scaling of Subject Grand Means." You will then be asked "Scale subject grand means to..." Leave this at the default of 50. (The easiest way to choose SPM defaults is to click with the left hand mouse button somewhere else in the window and press Return.)

  3. For "threshold masking" choose the "prop'nal" button. Then at the "analysis threshold (prop'n of global)" input, leave it at the default of 0.8.

  4. Next "Global Calculation..." is requested. Choose "mean voxel value." At this point the initial stage of the analysis will be calculated (which should take about five minutes of thinking time). All input parameters so far for the analysis will be saved once these calculations have been complete, allowing return to this stage at any later point in time.


  1. The end of this calculation will be marked by the design matrix appearing in the right-hand window. If you wish, you can use this to check whether you entered your conditions in the right order for your subjects. The first column corresponds to the first condition, the second column to the second condition, etc. The first row corresponds to the first subject's first scan, the second row corresponds to the first subject's second scan, etc. So if your first subject's eighth scan was whatever you designated as the third condition, the eighth row should have a white square in the third column. By this means you can check all scans for all conditions.
  2. As well as the design matrix marking the end of the initial analysis, there is also the question, "Estimate?" appearing at the foot of the bottom left window. If you wish to move onto looking at specific contrasts right away, then choose "now." This will complete the analysis from the parameters you have entered. If instead you have no more time for the analysis, you could choose "later." To complete the analysis at a later stage, start up SPM 99 (if it isn't already running), and press the "Estimate" button in the middle section of the top left window. You will be prompted via a dialog box to choose the "SPMcfg.mat" file. Make sure this is the same file as the one in the directory you initially ran the analysis from. After causing SPM to estimate your design, it will take about twenty minutes of thinking time to complete the analysis, ready for you to compare your conditions with each other.


  1. Once the estimate analysis has been successfully completed, you will be able to examine your conditions, by means of contrasts (see simple contrasts explanation page for help). To create or look at a contrast, you need to press the "Results" button in the middle of the top right-hand window. N.B. You can press this button at any later time, after starting SPM 99 up again, since everything up to now has been saved in the working directory that you ran the analysis from. A dialog box will appear asking you to choose the "SPM.mat" file. Again make sure that you choose the file that comes from the analysis you want to examine. As usual, press "Done" when you've selected the file you need.

  2. Once the file has been selected, another dialog box will appear, with the title, "SPM Contrast Manager." This is where you will be creating, or selecting all of your contrasts. To create a new contrast, press "define new contrast..." towards the bottom of the dialog box. Make sure the "t-contrasts" option is selected after this. At the top there will be a space, labelled "name" to put the title of the contrast. The next space down, labelled "contrast" is where you enter the details of the contrast (for more details on how to enter contrasts, click here ).

    When you are happy with the contrast as it is written in this box, you can preview it, by pressing the "submit" button just below and to the right of the box. The mini-design matrix on the right of the dialog box will show the contrast you have chosen as it corresponds to the conditions (the columns on the left). If this looks like the correct contrast, then press "OK" and the contrast is now stored along with your analysis. You should be able to see its name in a list of contrasts now. In order to inspect the results of this contrast, make sure it is highlighted, and press "Done."

  3. The dialog box will disappear and you will be asked a set of questions concerning how you want the graphical result of this contrast to look. For more information on this and on the graphical aspect of SPM generally, see the Graphical SPM help-page - the page is written for SPM96, but the ideas also apply to SPM99. If you are merely interested in basic output, though, press all the defaults, and a 'glass brain' will appear on the right hand window along with the activations for that contrast. Press "volume" in the lower left window and you will be given a list of all the significant peaks at the threshold you just specified. To return to this contrast (for instance to inspect it at a different significance threshold), press "Results" again, choosing the appropriate "SPM.mat" file, select this contrast from the list presented in the dialog box and then press "Done." At this point you will be asked the various graphical, etc. questions again. If instead you wish to create a new contrast, merely repeat the above procedure for creating a new contrast. You may do this at any later point, by starting SPM 99 up again, choosing "Results", and selecting the appropriate "SPM.mat" file.


Daniel Bor 20/12/99