brainstorm-tools / brainstorm3

Brainstorm software: MEG, EEG, fNIRS, ECoG, sEEG and electrophysiology
http://neuroimage.usc.edu/brainstorm
GNU General Public License v3.0
384 stars 162 forks source link

Model selection in specparam and SPRiNT #729

Closed lucwilson closed 2 weeks ago

lucwilson commented 3 months ago

Additions and modifications to implement model selection in specparam and SPRiNT.

Also removes GUI options for peak types. These were always experimental but can be slowly phased out as they are no longer being studied and have not been extensively validated (nor used in an article). Instead, users can select between default optimization settings (conventional implementations) and model selection (experimental).

This build still generates warnings when either the user does not possess the parallel processing toolbox or on first use of either specparam or SPRiNT. In this way, it is not ready to be merged quite yet. However, algorithm behaviour is as expected.

Tutorial: https://neuroimage.usc.edu/brainstorm/Tutorials/Fooof#Model-selection_.28ms-specparam.29

rcassani commented 2 months ago

@lucwilson, in an unrelated topic, there is a problem if if the requested window is smaller than the data. It is partially handled here: https://github.com/brainstorm-tools/brainstorm3/blob/e08897975c28effa586893804bdec27b95104e60/toolbox/timefreq/bst_sprint.m#L77-L83

However, it seems opt.nAverage needs to be updated there as well, otherwise, it leads to unexpected shapes for TF

TF = nan(size(F,1), Nwin-(opt.nAverage-1), size(FreqVector,2));