Displaying directly on the cortical surface without using the imaging kernel

Hi,

After computing the head model and sources, I have gain matrix G (15004x320) and time series data X (320x1000). On multiplying the two, I get the time series of each vertex on the head model, either cortical or deep brain model.

At this stage, I can compute complex nonlinear operations outside in MATLAB on the time series of each vertex. Say, for example, I calculated the coherence of the signal from each vertex and the stimulus signal at a particular frequency and obtained a coherence matrix C (15004x1).

I want to be able to find a way to map and display this matrix/vector directly onto the cortex like I can do it on the channels.

This seems like a general question and so I tried to find similar queries but failed to find any. If there is, please direct me to it.

2 Likes

You have two options:

  1. Creating a file similar to the data you want to display in the Brainstorm database, for instance take your source file and run the process Average time on it to get rid of the time dimension. Then export it to Matlab, modify the structure (ImageGridAmp must have two time points, just copy the same values twice), and import it back to the database:
    https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Custom_processing
    https://neuroimage.usc.edu/brainstorm/Tutorials/SourceEstimation#On_the_hard_drive

  2. Use the function view_surface_matrix.m. As parameter SurfColor, pass a matrix of RGB values one per vertex, as documented in patch parameter FaceVertexCData:
    https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/gui/view_surface_matrix.m
    https://www.mathworks.com/help/matlab/ref/matlab.graphics.primitive.patch-properties.html

1 Like

Thank you for your suggestions, Francois. Just what I needed to know!