Pythagorean Displacement and Motion Regressors
This Matlab script uses the Pythagorean Theorem to calculate head motion and position, while preserving degrees of freedom. The motion parameters output by SPM (rp*.txt) estimate head position relative to the first volume in 3D translation and 3D rotation, which are often entered as a nuisance regressor during individual-level statistics. Regressing the total displacement and relative position can potentially explain more variance in voxel-level BOLD signals that is related to head movement during an fMRI experiment.
works well with: