Matlab code for forward model calculation?

hello, i’m trying to compute the forward model (scalp potential) based directly on my cortical normal vectors which i’ve obtained through freesurfer. (ie, i have a volume x,y,z,n where n is a 3 element unit vector. i’d like to compute the potential every point in space of my volume, based on these unit vectors.

i’d prefer to not re-invent the wheel, and use pre-existing code, does anyone know where i can find this in the brainstorm source? thanks,

Russell

Hi Russel,

From the interface:

  • Right-click on the channel file > Compute head model > MRI volume > Regular grid > [OK].

To get the corresponding function calls:

  • Place a breakpoint in bst_headmodeler at line 353
  • Start the computation from the interface
  • When it stops, you’ll be able to explore how you’re supposed to set OPTIONS to run this manually.

Cheers,
Francois

i’ll try that, thanks Francois.