Brainstorm update and error computing maxPAC with Mex file

Dear All,
I would like to signal a problem that I encountered while processing the PAC over the sources of EEG signal on brainstorm. After I updated the software on Tuesday 08.08.2023, I was unable to run the analysis using the MEX file. The error didn't change even when selecting different input signals and different subjects or different time windows. In the past the same analysis ran smoothly on the same EEG of the same subjects. Here there's a copy of the error I get:

* Error: [process_pac]  Frequency > Phase-amplitude coupling
** Line 373: Arrays have incompatible sizes for this operation.
** 
** Call stack:
** >process_pac.m>Run at 373
** >process_pac.m at 29
** >bst_process.m>Run at 236
** >bst_process.m at 38
** >panel_process1.m>RunProcess at 124
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 777
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 298
** 

Could you provide me with some insight about it please?

Hi @umbertonencha, that error does not seem related to the update. It seems to be produced by these conditions:

  1. The output configuration for the PAC process is the Average PAC accross trials, and
  2. The option Exclude bad segments and bad channels is selected, and
  3. The trials have different number of channels. One or more channels are marked as bad in some but not all trials.

You can either:

  1. Uncheck the option Exclude bad segments and bad channels, in this case the channels marked as bad will be still used for the PAC average across files.
  2. If a channel is bad for at least one trial, mark it bad for all trials.