Dear SPM list
I am trying to batch the contrast definition in SPM2. The batch written by
R. Henson (from the SPM homepage) works for 1 run, but produces an error
message when I use it for all of my 8 runs.
My guess is that this has to do with the increased number of constants in my
model (one for each run), and thus my question is how to implement these
additional constants. In the archives I found that someone had asked the
same question earlier, but I could not find a response.
This is how the batch works with 1 run (4 conditions and 6 movement parameters):
**********
ocon = length(SPM.xCon); % default contrasts
eb = eye(SPM.xBF.order); % basis functions
cnam{1} = 'Canonical HRF: Stim > Baseline';
cwgt{1} = [kron([1 1 1 1 ],eb(1,:)) zeros(1,6)]; % zeros = movement params
ctyp{1} = 'T';
for c = 1:length(cnam)
cw = [cwgt{c} zeros(size(cwgt{c},1),1)]'; % pad with zero for constant
SPM.xCon(c+ocon) = spm_FcUtil('Set',cnam{c},ctyp{c},'c',cw,SPM.xX.xKXs);
end
spm_contrasts(SPM);
**********
I tried adding the constant in my contrast vector (cwgt) and putting that
vector directly into the SPM.xCon(c+ocon) expression, or adding the
additional 0's for the constants into the cw expression (cw = [cwgt{c}
zeros(size(cwgt{c},1),8), but neither of these worked.
I would appreciate any help.
Urs Maurer
|