No. The job below is the same as clicking the 'Results' button and then
choosing a contrast, threshold, extent. To add contrasts on the fly
(without the GUI), you can do something like this:
SPM.xCon(end+1) = spm_FcUtil('Set',cname,ctype,'c',c(:),SPM.xX.xKXs);
Where cname is the name of the contrast, ctype is 'T' or 'F', and c is
the actual contrast (e.g. [1 0 -1 0]). I have a script for that that is
extremely useful when you think of a contrast after the fact and need to
apply it to many different subjects.
Then, if you want to loop through a bunch of different contrasts, you
can see in the job below there is a variable called 'connum'. You could
do something like
jobs = struct('swd', SPM.swd, ...
'Ic', i, ...
and so on.
Dorian P. wrote:
> Thank you Chris.
> Does this work to define a contrast on the fly, when it's not defined
> previously in SPM.xCon ?
> 2009/11/24 Chris Watson <[log in to unmask]>:
>> You could create a job for spm_results_ui and then just get the length of
>> xSPM.Z. Something like this:
>> job = struct('swd', SPM.swd, ...
>> 'Ic', connum, ...
>> 'u', thresh, ...
>> 'Im', , ...
>> 'thresDesc', threshdesc, ...
>> 'title', SPM.xCon(connum).name, ...
>> 'k', k);
>> [hReg, xSPM, SPM] = spm_results_ui('setup', job);
>> Dorian P. wrote:
>>> Hi all,
>>> I want to extract the number of significant voxels for contrasts of
>>> 1st level, which would take a long time with the GUI.
>>> Anybody have a script or can suggest a way to do that in command line?
>>> Searched the archives but couldn't find an answer.
>>> Thank you in advance.