Hi Rodolphe and Glad,
the error you observed has been fixed in SPM12 (it was one of the first
bugs that surfaced after the release) and will be available in the next
set of updates. In the meantime, you can simply edit spm_getSPM.m such
that l.548 reads:
Gamma = full(sqrt(xCon(Ic).c'*SPM.PPM.Cb*xCon(Ic).c));
Best regards,
Guillaume.
On 17/03/15 08:49, Paul Glad Mihai wrote:
> Hi Rodolphe,
>
> You can of course do a classical first level analysis and use Bayes at
> the second level. However, I would try to estimate the model on the
> first level using Bayesian inference, since there are more advantages,
> one of which is the spatial prior. The "smoothing" is then automatic and
> based on the activation. Unfortunately it will take a very long time.
>
> 1) I have not used spm12 yet. Did you first do a classical estimation
> and then a Bayesian estimation? I assume you did, otherwise you wouldn't
> have had the Bayesian option. Apparently the sprintf function doesn't
> allow sparse matrices (most of its elements are zero). It would need to
> be a full matrix. If you go to line 549 you will see this just above it:
> % If Bayesian then get effect size threshold (Gamma) stored in xCon(Ic).eidf
> % The default is one conditional s.d. of the contrast
>
> How did you define the contrast?
>
> 2) The default effect size threshold should be one conditional standard
> deviation of the contrast. It's computed on line 548
> Gamma = sqrt(xCon(Ic).c'*SPM.PPM.Cb*xCon(Ic).c);
>
> You cold also choose something else as the threshold.
>
> Regards,
> Glad
>
>
> On 16.03.2015 21:32, Rodolphe Nenert wrote:
>> Dear Glad and Bayesian lovers,
>>
>> I had a few questions regarding Bayesian 2nd level inference.
>> As suggested, I first did my group level analysis using classical method
>> of estimation, then the bayesian 2nd level.
>>
>> 1) When i specify my contrast then click on bayesian option I got this
>> error:
>>
>> SPM12: spm_results_ui (v6200) 15:20:19 - 16/03/2015
>> ========================================================================
>> Error using sprintf
>> Function is not defined for sparse inputs.
>>
>> Error in spm_getSPM (line 549)
>> xCon(Ic).eidf =
>> spm_input(str,'+1','e',sprintf('%0.2f',Gamma));
>>
>> Error in spm_results_ui (line 261)
>> [SPM,xSPM] = spm_getSPM;
>>
>> Error while evaluating UIControl Callback
>>
>> 2) In the SPM12 manual, 1st level bayesian “threshold” is found using
>> this formula : sf = max(SPM.xBF.bf <http://SPM.xBF.bf>(:,1))/SPM.xBF.dt
>> since xBF field doesn’t exist in 2nd level analysis, how is it done?
>>
>> Any help would be greatly appreciated. thanks a lot,
>>
>> Rodolphe.
>>
>>
>>> On Mar 9, 2015, at 8:30 AM, Paul Glad Mihai
>>> <[log in to unmask]
>>> <mailto:[log in to unmask]>> wrote:
>>>
>>> Hi Anders,
>>>
>>> that's right, if you only have a contrast for the first regressor, then
>>> you can just use the Cbeta_0001.img.
>>>
>>> There is no spatial prior for the 2nd level, as I understand it. I'll
>>> just paste here what Will Penny wrote some time ago:
>>>
>>> "Briefly,
>>> 2nd level PPMs use a prior over the regression coefficients, beta, with
>>> zero mean and (co)variance Cb. The quantity SPM.PPM.Cb is an empirical
>>> estimate of Cb. The rest of the formula computes how much of this
>>> variance projects onto the contrast you are testing."
>>> https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=SPM;41144d5.1403
>>>
>>> "The procedure here is to Specify a 2nd level model - t-tests, ANOVA etc
>>> - then estimate it with the Classical option
>>> (you can also play with some contrasts here). Then estimate the model
>>> again using the Bayesian 2nd level option and you can create parameter
>>> inference and model comparison maps [1] by specifying contrasts in the
>>> usual way.
>>> Its perfectly valid to compare parameters to a threshold of zero."
>>> https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=SPM;5f9a54e5.1405
>>>
>>> I hope this helps.
>>>
>>> Regards,
>>> Glad
>>>
>>> On 09.03.2015 13:46, Anders Eklund wrote:
>>>> Dear Glad,
>>>>
>>>> since I'm interested only in the first regressor, I assume that a
>>>> contrast of [1 0 0 0 0 0 0 0] will give a file con_0001.img that is
>>>> identical to Cbeta_0001.img ?
>>>>
>>>> No I did not smooth the fMRI data, since SPM uses a spatial prior. I,
>>>> however, assumed that a spatial prior was also used for the group
>>>> analysis, and that the posterior variance was also included.
>>>>
>>>> - Anders
>>>>
>>>>
>>>> 2015-03-09 10:08 GMT+01:00 Paul Glad Mihai
>>>> <[log in to unmask]
>>>> <mailto:[log in to unmask]>
>>>> <mailto:[log in to unmask]>>:
>>>>
>>>> Dear Anders,
>>>>
>>>> Why don't you calculate the contrasts on the 1st level? You will then
>>>> get an idea of what the activation looks like. I hope you didn't
>>>> smooth
>>>> your EPIs prior to the 1st level Bayesian analysis.
>>>>
>>>> After you have your 1st level contrasts you will have to smooth
>>>> them in
>>>> order to increase the chance of overlap between subjects. The
>>>> smoothing
>>>> factor depends on what you want to look at. Here's a paper about
>>>> smoothing:
>>>>
>>>> Ball, T., Breckel, T. P. K., Mutschler, I., Aertsen, A.,
>>>> Schulze-Bonhage, A., Hennig, J., & Speck, O. (2011). Variability of
>>>> fMRI-response patterns at different spatial observation scales. Human
>>>> Brain Mapping, 1171(January 2011), 1155–1171. doi:10.1002/hbm.21274
>>>>
>>>> At the 2nd level you will take the smoothed con images, do a classical
>>>> estimation and then do a Bayesian estimation. I usually use the batch
>>>> editor and estimate on the prior dependency for the classical way,
>>>> then
>>>> create another dependency from the classical to do the Bayesian
>>>> estimation. The standard deviation from each subject is not used
>>>> in the
>>>> 2nd level analysis, since you only plug in the contrasts.
>>>>
>>>> I hope this helps.
>>>>
>>>> Regards,
>>>> Glad
>>>>
>>>> On 08.03.2015 10:54, Anders Eklund wrote:
>>>>> Dear SPM users,
>>>>>
>>>>> I'm trying to do a Bayesian group analysis in SPM8. I have looked
>>>> at the
>>>>> SPM8 manual but it is still a bit unclear to me.
>>>>>
>>>>> I have gone through each subject with a Bayesian first level analysis,
>>>>> so I have Cbeta_* and SD_beta* for all regressors. I would like to
>>>>> obtain a group level PPM of the first beta weight being larger
>>>> than 0. I
>>>>> used "Specify 2nd-level" and selected the Cbeta_0001.img for each
>>>>> subject. I then first do a classical estimation (which seems to be
>>>>> required prior to a 2nd level Bayesian estimation) and then do the
>>>>> Bayesian 2nd-level estimation. Does this procedure seem correct?
>>>>>
>>>>> If the procedure is correct, is the standard deviation from each
>>>>> subject, i.e. SDbeta_0001.img, used in the group analysis, or is only
>>>>> the posterior mean of each subject used?
>>>>>
>>>>> Regards,
>>>>> Anders
>>>>>
>>>>>
>>>>
>>>> --
>>>> P. Glad MIHAI, M.Sc. Biomedical Physics
>>>> Functional Imaging | University Clinic Greifswald
>>>> Walther-Rathenau-Straße 46 | 17475 Greifswald | Germany
>>>> Tel: +49 3834 86 69 44 <tel:%2B49%203834%2086%2069%2044>
>>>> <tel:%2B49%203834%2086%2069%2044> | Fax: +49
>>>> 3834 86 68 98 <tel:%2B49%203834%2086%2068%2098>
>>>> www.baltic-imaging-center.de
>>>> <http://www.baltic-imaging-center.de/> <http://www.baltic-imaging-center.de
>>>> <http://www.baltic-imaging-center.de/>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Anders Eklund, PhD
>>>>
>>>>
>>>
>>> --
>>> P. Glad MIHAI, M.Sc. Biomedical Physics
>>> Functional Imaging | University Clinic Greifswald
>>> Walther-Rathenau-Straße 46 | 17475 Greifswald | Germany
>>> Tel: +49 3834 86 69 44 <tel:%2B49%203834%2086%2069%2044> | Fax: +49
>>> 3834 86 68 98 <tel:%2B49%203834%2086%2068%2098>
>>> www.baltic-imaging-center.de <http://www.baltic-imaging-center.de/>
>>
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|