marsbar-toolbox / marsbar

MarsBaR region of interest toolbox for SPM
http://marsbar.sourceforge.net
21 stars 7 forks source link

rare crash when running mardo_5/estimate #8

Open Remi-Gau opened 1 year ago

Remi-Gau commented 1 year ago

Using marsbar to run some roi analysis within the BIDS pipeline we use in the lab.

I am getting this error once in a while when trying to estimate a model with MarsBar.

It is reproducible but only for specific to a given subject + ROI combination:

Also it seems that this crash is more frequent when using the FAST correction for auto-correlation rather than the default AR(1).

Error message

For the syntax spdiags(B,d,m,n), the size of B must be min(m,n)-by-length(d).

Error in pr_estimate (line 128)
    s     = spdiags(1./sqrt(diag(s)),0,nScan,nScan);

Error in pr_estimate (line 345)
    SPM = pr_estimate(SPM,marsY);

Error in mardo_5/estimate (line 72)
SPM        = pr_estimate(SPM, marsY);

Error in bidsRoiBasedGLM (line 119)
        estimation = estimate(model, data);

Related

related to https://github.com/Remi-Gau/olfactory_fmri_blind/issues/12 related to https://github.com/cpp-lln-lab/bidspm/issues/689

Could try to provide a minimal working example if that helps but that may take some time in terms of data wrangling.

matthew-brett commented 1 year ago

I'd expect the default SPM ReML autocorrelation to fail sometimes - is that what you mean? But I would expect the fmristat AR(1) to always succeed. Does it sometimes fail?

What do you mean by the FAST correction? (Sorry, it's been a while since I went back over this).

Remi-Gau commented 1 year ago

I'd expect the default SPM ReML autocorrelation to fail sometimes - is that what you mean?

yup

But I would expect the fmristat AR(1) to always succeed. Does it sometimes fail?

It failed something like 3 times out of 3000 (rough estimate). So pretty rare.

What do you mean by the FAST correction? (Sorry, it's been a while since I went back over this).

SPM12 lets you choose this for rapidly sampled fMRI time series

https://onlinelibrary.wiley.com/doi/full/10.1002/hbm.24218

Screenshot from 2022-11-16 21-37-42

Remi-Gau commented 1 year ago

FYI: a fix for this is not urgent at all

Just wanted to post this here in case someone else encounters this