Processing all source vertices in MATLAB, then importing back to brainstorm for display on cortex

Hello all,
I perform source analysis on data that I have. I understand that now I have an array of vertices covering the entire cortex. I would like to:

  1. export all of this data to Matlab for analysis (just for example - let's say that I want to derive all vertices in the time domain, meaning d[vertices-value]/dt)
  2. once the analysis is finished, I want to import the calculated values to brainstorm to display in back on the cortex (in this example - display derivative values by time on the cortex).
    Can you please guide me on how to do this?
    Thank you!

HI @SaarK

yes, this is possible.

you can check the content of the source analysis file here:
https://neuroimage.usc.edu/brainstorm/Tutorials/SourceEstimation?On_the_hard_drive

you can export any data from the brainstorm GUI by "right-click > file > Export to Matlab"
and then do you process on that file/data, then you can import it back by the same process, but select "import from Matlab"
You need to make sure that ll the fields are present on the imported file, otherwise Brainstorm will not recognize it.

@SaarK, note that in order to have the sources time series saved (and not only the inversion kernel), you need to select the option Full results (Kernel*Recordings)

image

1 Like

Thank you both very much! I really appreciate your answers!

Hey all - a related question please:
I realized that I have some NaN values in the source martix after my calculation. When importing the source matrix back to brainstorm, will a NaN cause problem when ploting sources on the cortex?
thanks!

Yes. Some of the issue will be:

  • Visually, they will not have any color (the color will be the one of the cortical surface)
  • Scouts containing NaN will not work anymore