My guess is that they are detrending the signal by regressing out x. In this case ones part is the offset, and 1: numTimeStampPerRun is the linear trend. You can always just use detrend in MATLAB though. EDIT: more explicitly, the linear fit has the form: x(t) = a*t +...

matlab,data-analysis,neuroscience

I'm not aware of a simple existing Matlab function/toolbox that directly does what you want, but all the elements are there and you should be able to program something like that yourself. The information which voxel in an image belongs to which anatomical brain region is provided by so-called atlases,...