Transforming segmented brain into FEM mesh

Hi,

Yes, you have computed a lead field using the 3shell method from the source space formed by the cortex (2002 nodes).

It seems that there is nothing related to the FEM in your computation, you are using a set of nodes that forms a cortical surface and you have used the 3shell method to compute the lead field (analytical solution).

In the attached image, you have the cortex with 2002 vertices, and it's a surface mesh (BEM) and note a volume mesh (FEM). You can export this surface to matlab ==> right click on the cortex, ==> file ==> export to matlab ==> give any variable name

then you will have the list of the vertices (nodes) and also the list of the faces (connectivity), but they are triangles and not tetrahedron.

From here you can export the mesh using you own functions, but it's a surface mesh and not a volume.
If you want to have FEM mesh, you can refer to these tutos :
https://neuroimage.usc.edu/brainstorm/Tutorials/Duneuro
https://neuroimage.usc.edu/brainstorm/Tutorials/tutoFEMadvanced

A+
Takfarinas