PetPreprocessing - MRC CBU Imaging Wiki
location: PetPreprocessing

PREPROCESSING OF PET/MRI DATA


This page describes the usual preprocessing of activation PET data 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. If there was a structural MRI scan, this will either be in the the same directory as the PET scans, above, with the file name 3d_mri.img, or in the directory:

[some directory] / [subject number] /m00/00/

with the same file name "3d_mri.img".Note that the instructions below relate to both SPM96 and SPM99. We recommend you use SPM99. When you see interpolation referred to as "bilinear" below, this is the same as "trilinear", which is the term more often used in SPM99.

The steps below assume that your data has been appropriately converted to analyze format. At the CBU, this is almost always done by the WBIC. Analyze format data consists of an .img and a .hdr file for each image - see the Analyze format page for more details.


  1. In Xterm (or similar) session, change the current directory to directory of subject to be preprocessed, then change directories until you reach the SPM files' directory, resembling the following: ./<subject number>/p00/00/spm .

  2. Run SPM and choose PET and SPECT option.

  3. Choose the Realign function in the top left hand corner (this will detect movement between the scans in the activations series, and translate/rotate the images back into alignment). Input the number of subjects as 1 and press enter (or mouse click outside the box to accept the default as 1 and press enter - you can use this method for all future acceptances of the defaults). If you ran SPM from the right directory, this should already be correctly set when the dialog box comes up. Check that the directory the in dialog box resembles:

    [subject number] /p00/00/spm/<filenames> All of the filenames will be of the type emiss_0xx_tra.img, where "xx" is a scan number, usually between 00 and 11

    Select all and press done (by selecting all the program will automatically define the first scan as 'No. 1'. If you would like to realign to a different scan, then select that particular scan first and select all the other scans in any order).

    Then choose co-register & re-slice.

    Then choose "Trilinear", or, in SPM96, "bilinear" interpolation.

    The program will then ask you to create what?. Select mean image only. This will produce a mean image file, which is a mean of all the images, aftern they have been aligned.

    Check translation and rotation - make sure that the translation varies by no more than approximately + or - 5 mm and the rotation varies by no more than approximately + or – 5 degrees. These will be found in the graphics box (normally on the right).

  4. If you are using SP99, skip to the Coregistration. If you are using SPM 96, you will need to do a second realignment, of all the images to the mean image you have just created. This is because there is some remaining misalignment, which can be detected as quite a large mean difference between the first and all subsequent images in the series. You don't need to do this second realignment with SPM99, because it realigns to the mean image by default. To do the second realignment, choose realign again (this second realignment realigns each of the scans to the mean which you have just created). Choose the number of subjects as 1. Choose 'meanemiss._000_tra.img' so that it is image 1 (this defines the first image for comparison with the rest).

    Individually select all the other scans (preferably in order). If you choose a wrong scan, then click again on it to cancel. When finished press Done.

    Choose co-register & re-slice again.

    Choose bilinear again.

    Choose mean image only again.

    Translation and Rotation The translations and rotations in this second realignment, as reported by SPM96, should be very small indeed. The parameters are the extra movements necessary to realign the images to the mean, having started where the previous realignment left off.

  5. For both SPM96, and SPM99, you may want to do the following steps if you have a structural MRI scan. If you don't have a structural MR scan, you should skip to Normalising. These steps below will coregister the MRI scan to the mean PET scan. You can then use the MRI scan for various structural type things. Choose Coregister. Choose number of subjects as 1.

    Choose co-register & re-slice.

    For modality of target image?, choose PET.'

    For modality of first object image? choose object - T1 MRI.

    In the dialog box "select target image" choose "meanmeanemiss_000_tra.img" (if you have done the double realignment with SPM96) or "meanemiss_000_tra.img" (if you did the single realignment, with SPM99).

    In next stage of dialog box select object image choose '3d_mri.img' which should be found in the <subject number>/m00/00/ directory.

    In next stage of dialog box select other images make sure nothing is selected and just press the done button. Have a look at the output from the resulting segmentation. Make sure that the left-hand column resembles normal brain slices while the other columns demonstrate appropriate and clear tissue types (grey matter, white matter, cerebral spinal fluid, other (nose, skull, etc.) from left to right). In Coregistration, make sure that the MRI lines match up closely with the edges of the PET images.

  6. Time to This step warps the individual brains to the shape of a standard brain, so that you can compare the signal from brains of different individuals.

    Choose Normalise.

    For "Which option" choose "Determine parameters only" For number of subjects choose 1.

    For dialog box image to determine parameters from Select either "3d_mri.img" (if you have have a coregistered structural MR, and you want to use it for normalisation), or the mean PET image (in the subject's PET files directory). Note that the "3d_mri.img" is the raw MRI image, but after the coregistration it will have a .mat file, describing the transformation necessary to map it to the space of the PET image. For a little more on .mat files, have a look at the Analyze format page and links therein.

    Thence, when SPM asks for template image respond with "T1.img" if you are normalising the MR, or "PET.img" if you are normalising the mean PET image. These are the "standard" brains based on those from the Montreal Neurological Institute. Note that these brains are not an exact match to the Talairach atlas; see the MNI - Talairach page for more discussion of this topic. The mean PET or MR scan will now be "warped" into a "standard" shape.

    Normalisation comparison When the normalisation has finished, make sure that the three template images on the left match closely to the subject's normalised three images on the right. If you are using SPM99, you can click in the images to move the cross hairs around, to look at equivalent areas in the scan and the template. This checking is very important; if the scans are not well normalised then large apparent signal changes can result that are merely artefacts of comparison of different parts of the brain in different people.

    When you are satisfied with the normalisation, you can write out the normalised images. Choose "Normalise" again. Choose "Write normalised only" from the list. Return number of subjects as "1". In the file selection dialog box, go to the directories with the subject's data, and choose the normalisation parameter file: if you normalised the mean PET image, this will be something like "meanemiss_00_tra_3n3d.mat" in the directory containing the mean image; if you normalised the coregistered MR, this will be something like "3d_mri_sn3d.mat", in the MR directory. In the next stage of the dialog box images to write normalised go to the directory containing the PET images. and select the original 6 or 12 activation PET scans as appropriate, e.g: emiss_000_tra.img (don't forget these images are now aligned to each other by the .mat files created during the realignment process - see the SPM99 image format page for more details on the .mat file). Choose "bilinear interpolation", and wait for the process to finish.

  7. Choose "Smooth". For "smoothing" type "16". However, bear in mind, this choice is pretty arbitrary - see the smoothing tutorial for more details and links. In the select scans dialog box, choose the all the normalised images, e.g. nemiss_000_tra.img, nemiss_001_tra.img, etc. This process will produce a series sn* upon which the subject's data can be statistically analysed. For example the first file would be: snemiss_000_tra.img.


Daniel Bor, Matthew Brett and Adrian Owen 22/3/99. 11/10/99

CbuImaging: PetPreprocessing (last edited 2013-03-07 21:24:07 by localhost)