Generate surrogate data error

Hello,

I am trying to use generate surrogate data for tPAC analysis, but I run into this error while running the process:

My process was selected as such:

and the files I used were MEG data in source space. It happens only sometimes, but I am not sure which factor may cause this yet. Any help on how to avoid this would be appreciated!

LingXin

@Samiee @Sylvain

Update:
I tried to use a different length for the sliding time window (0.5s) and it works, but I am not sure why the 0.25s does not. The single band tPAC works fine with the latter window length.

I have also exchanged emails with @Samiee already, it should not be associated with PAC (correct me if I am wrong).

Thank you :slight_smile:

Hi Lingxin,

Good that you could run it with longer windows. I will try to figure out why it is sensitive to window length, fix the potential bug!

Hi @Francois,

For data exploration, I have computed tPAC for an ROI for a small number of subjects and trials and I am facing a few issues.
The tPAC maps are computed for every vertex in the scout, I understand the reasons for doing this but when I add all the tPAC maps to process 1 to compute average I get a mean tPAC map for every subject, rather than one representative (mean) tPAC map across all the trials/subjects. How do I average them across subjects?

I have followed the following process -
tPAC maps (Full) in process 1 -> frequency -> time-resolved PAC -> Basic analysis of tPAC maps -> Mean (Over sources, use phase in averaging).

The second issue I have is with extracting comodulogram from tPAC maps.
When I run the process with the following parameters, I get an error (see below).
Method: All sources/channels together
Files: Extract one comodulogram from all files (interpolate the comodulogram selected)

** Error: [process_pac_comod] Frequency > Time-resolved Phase-Amplitude Coupling > Extracting comodulogram from tPAC maps
** Line 405: Index exceeds the number of array elements (0).
**
** Call stack:
** >process_pac_comod.m>Compute at 405
** >process_pac_comod.m>Run at 204
** >process_pac_comod.m at 39
** >bst_process.m>Run at 229
** >bst_process.m at 36
** >panel_process1.m>RunProcess at 151
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 788
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 312
**
**

And lastly, the surrogate tPAC - block resampling - version 3.4 is option is greyed out completely. How do I use this option?

Is there something that I am doing incorrectly here?
Thanks

@Samiee @Sylvain?

Hello,
I updated to the newest version of brainstorm and the surrogate tPAC works.

1 Like

Good! :slight_smile:

1 Like

Hi @Samiee,

I am on the latest version of brainstorm and I am still having the same issues.
Under tPAC -> surrogate tPAC is still greyed out. And extracting comodulogram doesn't work either. It produces the error that I have posted above.

For all these operations I am using tPAC: ROI (Full) matrix as input (over multiple trials and subjects). Any help would be highly appreciated.

I am running BST on a Centos server.

Edit: When I run the average tPAC under basic analysis of tPAC maps. The output is a mean tPAC for every participant for every trial, instead of one representative tPAC map across the whole group.

Hi @Proxima

Most probably you do not provide a correct input file format, that is why that option is grayed out! For surrogate tPAC, you need to provide the data itself (either in source or sensor domain -- the same data as what you've provide to compute tPAC itself initially). Also make sure you do NOT have the option of "average PAC maps ..." at the end of setting page marked for computing the original PAC and surrogate data.

It should help with your problem, if not let me know to check the problem in more details.

Best,
Soheila

Hi @Samiee

Thanks for the clarification on surrogate tPAC.

I am still facing two issue.

  1. I am unable to extract comodulogram from the tPAC full matrix.
    Even for an individual subject. Here's the error I get -
    I add the tPAC: ROI (Full) matrix in process 1.

** Error: [process_pac_comod] Frequency > Time-resolved Phase-Amplitude Coupling > Extracting comodulogram from tPAC maps
** Line 405: Index exceeds the number of array elements (0).
**
** Call stack:
** >process_pac_comod.m>Compute at 405
** >process_pac_comod.m>Run at 204
** >process_pac_comod.m at 39
** >bst_process.m>Run at 230
** >bst_process.m at 37
** >panel_process1.m>RunProcess at 151
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 788
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 312
**
**
** File: Group_analysis/CA_IM1/timefreq_dpac_fullmaps_210226_2351.mat
**


  1. I am also unable to average the tPAC maps to generate one representative comodulogram per group.
    I add all the tPAC: ROI (Full) in process 1 -> Basic analysis of tPAC maps -> mean (over sources).
    But this is producing a mean file per participant, rather than one for an entire group.

Thanks for your help.

Hi @Proxima,

For your first problem, please share a snapshot of how you filled the inputs for (1) tpac calculation, (2) comod calculation. I think at least one of the arguments is not set properly.

For the second one, you should be able to average all the files using: Frequency > Time-resolved ... > Average PAC maps.
(If you want to average the sources of the RoI as well you can do so after getting the average over files).

Hi @Samiee,

Thanks, managed to get the averages.

Here are the screenshots -

  1. Input parameters for tPAC analysis

  2. Input parameters for extracting comodulogram