If you do [hReg xSPM SPM] = spm_results_ui('setup', job) it shouldn't
prompt you for any information (although it's possible that I had to
modify spm_getSPM as well, and just forgot about it).
Dorian P. wrote:
> Hi again Chris,
>
> The matter is that "spm_results_ui" requires input from the user
> (asking mask, threshold etc). I've modified spm_getSPM now to get xSPM
> structure without user input and count xSPM.Z.
>
> Thanks for the help on contrast definition without GUI.
>
> Dorian.
>
> 2009/11/24 Chris Watson <[log in to unmask]>:
>
>> 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);
>> spm_contrasts(SPM);
>>
>> 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
>> for i=1:length(SPM.xCon),
>> 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 ?
>>>
>>> Dorian.
>>>
>>> 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.
>>>>> Dorian
>>>>>
>>>>>
>>>>>
>>>>>
>
>
|