Connectivity Power Spectrum Export

Hi BrainStorm team,

I’d like to export the power spectra that I generated from performing NxN magnitude-squared coherence as either CSVs, .XLSX, or .MAT files, for further plotting and analyses in MatLab.

Is there a way to export–ideally, batch-export–these spectra? Using the “File → Export to File” process in the pipeline editor does not produce the files I’m looking for (it exports time series data for the selected channels, not coherence spectra).

Thanks for your assistance.

Hi @MPorter, connectivity files are 4D (nSignalsA, nSignalsB, nTime, nFreq), as such the dimensions have to be reduced to 2D before saving in tabular formats.

One way to do so, would be to:

  1. Load the contents of the coherence .mat file
  2. Get the coherence spectra for each pair of signals
  3. Save the coherence spectra in a tabular data file

Check this snippet: