Dear Dimitri,
I'm no SPM author but the adjustment is correct as with the former, the stimulus "on" periods would have started one time bin (= microtime resolution/TR) too early. With the default microtime settings there are 16 time bins a TR. Now assume the stimulus onset coincides with the TR onset of the second TR. We would thus expect a stimulus function u with
zeros(1,32) % these are 32 dummy time bins at the beginning of the experiment
zeros(1,16) % these are the 16 time bins of the first TR in which the stimulus is still "off"
ones(1,n) % these are the n time bins of the following TRs in which the stimulus is on
However, the old code resulted in
zeros(1,32)
zeros(1,15)
ones(1,n+1)
Note that with the current code, any stimulus "on" period will actually be modelled one time bin too long, that is e.g. 2 time bins instead of 1 time bin, 10 time bins instead of 9. The reason is that this way, zero durations (or actually, rounded durations >= one time bin) are modelled as one "on" time bin, as there MUST be SOME "on" period in the stimulus function. As there might be both zero and non-zero durations within a single design (or durations rounded to zero and non-zero time bins) the simplest solution is to just go with the rounded onset plus one dummy time bin. As recently stated, in case of non-zero durations only it would be more "accurate" to go with the following though:
ton = round(ons*TR/dt) + 33; % onsets
tof = round(dur*TR/dt) + ton; % offset
or to avoid possible subtle issues due to rounding in some instances,
ton = round(ons*TR/dt) + 33; % onsets
tof = round((ons+dur)*TR/dt) + 33; % offset
While shifting onsets/durations should have some effect, note that there have been several other changes which I would assume to affect the data more strongly. E.g.
1) the default microtime settings in older SPM versions were microtime resolution 16, microtime onset 1, which was set to microtime resolution 16, microtime onset 8 in SPM12
2) the modification to account for low variance voxels as described in Ridgway et al. (2012, http://dx.doi.org/10.1016%2Fj.neuroimage.2011.10.027 ), which was introduced with r4290
3) several other fixes e.g. dealing with data voxels with exact value of 0 (e.g. r5191, r5222, but see the changelog @ http://www.fil.ion.ucl.ac.uk/spm/download/spm8_updates/README.txt ).
Best
Helmut
|