SPRiNT error - index exceeds matrix dimensions

Hi,

I am trying to implement the SPRiNT toolbox (with default parameters) on EEG data and MEG source reconstructed data. However, I am getting these error messages:

for EEG data:

** Error: [process_sprint] Frequency > SPRiNT: Spectral Parameterization Resolved in Time
** Line 335: Index exceeds matrix dimensions.
**
** Call stack:
** >bst_sprint.m>remove_outliers at 335
** >bst_sprint.m at 282
** >bst_timefreq.m at 560
** >process_timefreq.m>Run at 296
** >process_timefreq.m at 28
** >process_sprint.m>Run at 160
** >process_sprint.m at 27
** >bst_process.m>Run at 235
** >bst_process.m at 38
** >panel_process_select.m>ShowPanel at 3071
** >panel_process_select.m at 32
** >bst_report.m>Recall at 1387
** >bst_report.m at 63
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@bst_report,'Recall','current') at 299
**
**
** File: Subject01/sj0001_resting_band/data_block001.mat

for source reconstructed MEG data:

** Error: [process_sprint] Frequency > SPRiNT: Spectral Parameterization Resolved in Time
** Line 670: Index exceeds matrix dimensions.
**
** Call stack:
** >bst_sprint.m>robust_ap_fit at 670
** >bst_sprint.m at 205
** >bst_timefreq.m at 560
** >process_timefreq.m>Run at 296
** >process_timefreq.m at 28
** >process_sprint.m>Run at 160
** >process_sprint.m at 27
** >bst_process.m>Run at 235
** >bst_process.m at 38
** >panel_process1.m>RunProcess at 124
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 776
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 297
**
**
** File: link|COB01/COB01_COBRAM_20180131_04_resample/results_MN_MEG_KERNEL_180824_1817.mat|COB01/COB01_COBRAM_20180131_04_resample/data_Fil_adj_Corr_trial002.mat

The two errors seem fairly similar (except for the first two lines) but I couldn't figure out what is causing them. I have updated Brainstorm to the most recent version to date (10/19/2022) and I am using Matlab version R2016b.
I would really appreciate any hints on how to solve this problem. Thanks!

@Luc ?

Thanks for bringing these issues to my attention!

The first issue is a bit tricky, but I can recreate it under very specific circumstances. Specifically, if you do not have MATLAB's optimization toolbox, it is possible that no peaks are being fit for a specific channel which leads to this error. This particular issue can be quickly resolved (I can have a patch ready within a day or so). Do you have MATLAB's optimization toolbox?

The second issue is most likely to occur if the length of your data is insufficient for the short-time Fourier transform's number of windows averaged per time point. For instance, if you are using 2 s of data TOTAL, you would not have enough data to use the default settings of 5x1 s windows with 50% overlap (requires a minimum of 3 s). Does this sound like your input data length?

Please let me know if your situations are similar to the two described above, as this will mean we have identified the problems and can have fixes out shortly :slight_smile:

@saralago
@Francois

Hi Luc,

thanks for your reply!
No, I don't have MATLAB's optimization toolbox, should I install it? In addition, I tried running the SPRiNT function on inputs with different lengths (3 to 60 seconds), and I kept getting the same errors as in my first message. So I hypothesize that these errors are due to the absence of the optimization toolbox and not to the input lengths.