Time and movement effects
Covarying out movement in PET analyses
Why covary out movement from PET analyses? It turns out that there is a significant component of variance in PET studies that can be explained by movement between scans - see my HBM99 abstract on time effects. It may increase your activation signal, and will very likely reduce artefacts, if you try and covary these effects out of your data.To do this, you will need the movement parameters of each scan, in terms of x y and z translation and rotation, relative to the first scan for that subject. I have used estimates of these parameters relative to the anterior commissure (AC).
To acquire these, you will need to change the .mat files for each subject. You should do this after you have done realignment between scans for each subject.
First copy the .mat files for each subject's raw (unresliced) activation images to a backup directory, with a command like:
cp emiss*.mat matbu
from the directory containing the activation scans, where the activation scans are called emiss [something].img, and "matbu" is a subdirectory you have created in the directory containing the PET files.Now, change the .mat files to be relative to the AC; start SPM99b, click on the Display button. Select the mean image generated from the realignment, if you have it (here "meanemiss_000_tra.img"), or one of the raw activation images, here say "emiss_000_tra.img", if you do not. Using your skill and judgement, and the translation/rotation input boxes at the bottom left of the graphics window, change the X Y and Z translations so that the blue crosshairs on the image point at the anterior commisure. Be careful not to click on the image while you are doing this, as it will put the crosshairs in the wrong place (not at 0 0 0). If the image is very far from the correct rotation relative to the MNI brain, you might also want to change the rotations.
When you are satisfied, click on "Reorient images" and select all the activation images - say "emiss*.img". Note that you should on no account choose the resliced realigned images e.g "remiss*img" or the normalised images "nemiss*img", or "snemiss*.img".
Reorienting the images will reset these images to have mat files relative to the AC. Do this Backup mats-Display-Adjust-Reorient thing for all the subjects in your analysis.
To get the movement parameters, you will need my little movement parameter extraction utility. This is installed in the CBU. Users outside the CBU may want to copy the files in the movement utility directory to a directory on their matlab path, in order to run the following steps.
Now, if you are not already running SPM99, start it up now. At the matlab prompt, type:
mparams = getrparams_sub
You will be prompted for the number of subjects, and then, for each subject, the mat files for the images for that subject. Select the mat files for theraw imagesfor each subject - not the realigned or normalised images. For example, for the case above, the mat files would be "emiss*mat" rather than "remiss*mat", or "nemiss*mat". Select the subjects in the order they will enter the statistical analysis and the scans in the order they will be entered also (normally in scan order).When you have done, you should see a large N by 12 matrix printed out into the matlab window, where N is the sum of the number of scans for each subject. At the moment this N by 12 matrix is stored in the "mparams" matrix variable. However, the last 6 of these columns are not needed, and should contain 1 1 1 0 0 0 for all scans (these are respectively the zooms and shears for each scan, relative to the first. As the realignment is rigid-body, it does not allow zooms or shears, so these should be the values above). You need to prune this mparams matrix to be just the first 6 columns which are the x y and z translations, and the x y and z rotations, respectively.
To do this type:
mparams = mparams(:, 1:6);
You should check this matrix to make sure it is as you expect. There should be one row for each scan, the row corresponding to the first scan for each subject should have (very near) zeros in all six columns. The first three columns should have sensible values for translations in mm (typically less than 10 for a reasonable PET study), and columns four to six should have reasonable values for rotation in radians (usually less than 0.2 ish).
Then save this matrix for further use, with:
save mparams mparams
in the matlab window, which saves the matrix as a "mparams.mat" file in the current directory.When you come to do the analysis, start up SPM. Before you start the analysis, load the mparams matrix back into matlab with:
load [dirpath] /mparams.mat
in the matlab window, where [dirpath] is the directory where you saved mparams.mat before. Of course, if the mparams.mat file is in the current directory, you could just type:
Then, during the statistics prompts in spm96 or 99, enter the scans into the analysis in the same order as you selected the scans before, when running "getrparams_sub". Specify 1 (set of) nuisance variables (=covariates of no interest) and, when prompted for the values, type "mparams", which should enter all the columns into the analysis.
If you put the movement parameters into the analysis, as above, then you will remove almost all the effect of scan order from the analysis (see my HBM99 abstract on time effects ). However, it is usually worth adding scan order as a covariate as well, as it (usually) explains some small but significant amount of additional variance. To add scan order as a covariate, you will need to prepare another column of numbers, with rows that correspond to the scans in the analysis, where the values in each row give the order of the scan in the session. See adding covariates as a text file for the general procedure. Here you would prepare the text file, as the link explains, then, in the analysis, specify two (sets of) covariates (in SPM99), enter the movement parameters as the first, and load the text file with the scan order (see the link) as the second.Phew. That's it.
Matthew Brett 11/10/99