Dear Elias,
I can think of three ways to generate the contrast weights in your
situation:
1/ write a script that will take care of the different number of
regressors per session
2/ use an option of the batch interface, thanks to Volkmar:
SPM > Stats > Contrast Manager
Contrast Sessions > T-contrasts (con/sess based)
3/ regress out covariates without including them explicitly in the
design matrix, as you hinted. To do so, specify your GLM in the usual
way without the movement regressors, then:
load SPM.mat
for s=1:numel(SPM.xX.K)
SPM.xX.K(s).X0 = [SPM.xX.K(s).X0 detrend(mvt_sess_s)];
end
save SPM.mat SPM
and specify your contrasts without having to worry about the number of
covariates you included per session (and double check I don't overlook
anything).
Best regards,
Guillaume.
--
On 23/04/15 12:55, Elias Mouchlianitis wrote:
> Dear SPM experts,
>
> I have a phMRI with 6 sessions for each subject, within a 3x2 design (3 drugs x 2 task levels), with each session representing a factorial level. As you might understand the 1st-level design matrix becomes quite complicated when including regressors for the motion parameters and columns from a confound matrix that regresses out outlying volumes as computed with DVARS. The issue is that since each subject has different number of outlier volumes, there is no consistency across subjects when defining contrasts and zero padding for the outlier columns differs both across sessions and subjects This is doable with a bit of matlab but i was hoping there is a simpler way (or maybe I am missing something obvious...)
>
> I was wondering whether there is a way to implicitly model movement regressors, outlier scans (or other regressors) without actually including them in the design matrix, similar with how FSL for example outputs the design matrix only for EVs.
>
> It would be great if anyone can point to a way to do this either within SPM or with a utility/toolbox.
>
> If not, maybe it is something that SPM developers should think including in future releases? with phMRI and other similar experimental and methodological advances, designs can become quite intricate, at least in my mind it would be most beneficial if one was given the option to model regressors explicitly or implicitly in the design matrix.
>
> Many thanks,
>
> Elias
>
>
>
> .
>
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG