Ft_freqstatistics - Option to specify frequencies

Hi all,

I have computed the PSD for some resting state data, and would like to run permutation cluster-based stats for a specific frequency range (beta: 13- 30 hz). I notice that there isn't an option to select the frequency range in the GUI window for ft_freqstatistics. I know the fieldtrip offers this option (cfg.frequency = [begin end], (default = 'all')), so I went to the 'process_ft_freqstatistics' script and manually made a change at line 214 to specify my frequencies of interest: statcfg.frequency = [13 30];
It seems to work, but when I try opening the results from the Brainstorm GUI i get the following error prompt:

image

I could export the results to Matlab to view the results, but I'm wondering if it is possible for users to have an option in the ft_freqstatistics GUI window to select specific frequencies and plot the results instead? I'm still very new to Brainstorm and not at all very good with coding, so my 'method' is extremely cumbersome.

Best regards,
Jane

It seems to work, but when I try opening the results from the Brainstorm GUI i get the following error prompt:

This is simply because the file that is saved in the Brainstorm structure does not contain what is expected to contain. The modification you made removes some of the frequencies in the FieldTrip call, but which are not removed from the Brainstorm database.
I guess that the offending combination of fields is the dimensions of the variables pmap/tmap (Nchannels x Ntime x Nfreq) and list of frequencies Freqs which is set in bst_process.m, not in the process function you modified.

To modify file structures:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Custom_processing

I could export the results to Matlab to view the results, but I'm wondering if it is possible for users to have an option in the ft_freqstatistics GUI window to select specific frequencies and plot the results instead?

Given the existing structure of the calls for the statistics function, it is not easy to add an option to select a subset of frequency bins in the process process_ft_freqstatistics.

The easiest option for you is maybe to do this frequency selection before calling the test. Two versions:

  1. When you compute the PSD, in the options you can directly average the bins of interest in a specific frequency band. If you know you are interested only in this frequency band and will not be looking at individual frequency bins, this is the best option.
  2. You can also run the processes "Extract > Extract values" or "Frequency > Group in time/frequency bands" on all your existing PSD to select and/or average some specific frequency bins. Select option "overwrite" to avoid the complexity of having two PSD files for each recordings file. (Make a copy of everything before destroying all your database, and set up a backup if you don't already have one)