JoramSoch / MACS

MACS – a new SPM toolbox for model assessment, comparison and selection
GNU General Public License v3.0
22 stars 6 forks source link

cvLME: different number of regressors per session #12

Closed BAshinoff closed 1 year ago

BAshinoff commented 1 year ago

Hi,

First, thank you for putting together this amazing toolbox!

I am having the classic (after reading through the prior issues) issues where I have a different number of regressors per session which is causing the cvLME to fail. I am trying to add dummy regressors, but was hoping to avoid regenerating the SPM.mat files from scratch since it takes a long time to get a complete file (if I run the whole SPM analysis pipeline -- but maybe I don't need to do all that?).

I am working on adjusting my SPM file, specifically the SPM.xX.X design matrix and the SPM.xX.name file of regressor names, to add extra columns for the "missing" regressors in some sessions.

Will this solve the problem or are there other components within the SPM file that would need to be adjusted as well?

Also, I would like to make a feature request to have the toolbox automatically add the dummy regressors when needed.

Thanks!

Cheers, Brandon

BAshinoff commented 1 year ago

Hi, I think I figured it out.

I realized that I can generate new SPM files without running the full analysis so I am going to try that.

Cheers, Brandon

JoramSoch commented 1 year ago

OK. Great to see it could be solved!

For those reading this later, please also see here.

BAshinoff commented 1 year ago

For anyone else who runs into this issue, I had to re-run both first-level model specification and model estimation in SPM for each participant to get the correct SPM.mat files. Model specification doesn't output the whitened matrix, which the toolbox needs (not sure if there are other things it needs too from model estimation).

JoramSoch commented 1 year ago

Yes that's correct. If a model has only been specified so far, the whitening matrix is estimated. MACS uses information from the SPM.mat and the mask image. Everything else (e.g. beta images) can in principal be deleted, if you're doing Bayesian model inference (first-level cvLME and second-level cvBMS), but not if you're doing classical goodness of fit.