Table of Contents

Displaying the motion-parameters of a subject

Motivation

While SPM writes out the motion parameters into a text file, sometimes only the files remain (e.g. after pruning the folders). For such cases, the motion parameters can be retrieved from the Analyze files and re-displayed using the showspmrparams function.

Requirements

This function reads motion parameters from the following files:

Usage

The usage is straight forward. Simply change into the folder where the run folders are located and execute the following command:

showspmrparams_example.m
% only read from run folders with "attention" in their name
% and read raw files (which begin with a capital letter S)
[f, rpf] = showspmrparams([pwd '/*attention*'], struct('source', 'S*.hdr'));

Output

Next to the figure handle (in this example variable name f), the function also returns the motion parameters for further plotting or scripting commands such as max(rpf) - min(rpf) (which would give the peak-to-peak distance, a.k.a. as maximum motion in each of the six degrees of freedom).

The graphical output looks like this:

showspmrparams output with two runs and 200 volumes each