FEM Mixed head model

I'm trying to construct a mixed head model following the DeepAtlas tutorial, except using an FEM instead of BEM approach. I generated a FEM from the ICBM152 template using simnibs. I then constructed the surface file for the cortex and deep structures by merging the aseg atlas (5000 vertices) and the cortex (5000 vertices), and set the source model options to deep brain. I don't get any errors when I compute the head model, the but lead field vectors look much too large from a small number of vertices in the cerebellum:

I tried it again using the BEM approach and got more reasonable results:

I concluded the issue is probably related to the meshing in the FEM, so I extracted the surfaces and remeshed using iso2mesh-2021 and mergemesh with a smaller max volume, but got the same result. I also tried creating the FEM in simnibs with a higher vertex density, but again got the same result. Finally, I increased the number of vertices in both the aseg atlas and cortex to 15000, but still observed large vectors from those vertices in the cerebellum.

Do you have any suggestions for parameters I might change to get a better result? I would really like to use the FEM approach so I can use diffusion tensors in the head model.



@tmedani Any suggestion?

1 Like

I went digging through the bst_duneuro.m script, and the problem is now obvious, though I don't have a solution yet.

The script is not fully written for 'mixed' or 'volume' head model support, specifically for shrinking the cortex surface and forcing dipoles within the GM layer. Even though I have "Force source space inside layer "gray"":

There is no code to actually enforce that constraint.
Starting at line 188, there are switch cases that are empty for 'volume' and 'mixed':
switch (cfg.HeadModelType)
case 'volume'
% TODO or keep it as it's now....
case 'surface'
case 'mixed'
% TODO : not used ?

Any help in coding the 'mixed' case to enforce the grey matter constraint would be greatly appreciated.


Hello Kyle,

Thanks for the detailed report on this issue and for your deep investigations on the code.

Indeed the mixed source model is not completely implemented within the Brainstorm-FEM.

The LFs that you obtain with the FEM are not stable in some points. The main issue with the FEM is the definition of the dipoles (PI, Venant, subtraction, ...), and the accuracy depends also on the location of the dipoles within the brain volume. In your case there are some dipoles which are located at the interfaces between different tissues (=> jumps in the conductivity values), that why you have these big arrows in some areas.

The option "Force source space inside gray " will not help with the current version for you case.
If you checked this option, all the dipoles will be projected to the nearest pint on the gray cortical layer, thus all you deep source will be moved from the deep structure during the computation ==> do not use this option in your case.

One possible solution in this case is to refine the mesh in the surrounding areas where you place your dipoles (within all the gray layer and all the surrounding areas of the deep structures).
And then you can try the FEM either with the Venant or the PI source model.

Let us know if you were able to perform to get better results.
Also, let me know if you need help on how to refine the mesh, these functions are not yet within Brainstorm.

For the BEM there is no issue with the conductivities, since all the inner skull surface is smooth, isotropic and homogenous.


Thanks tmedani for your response.

all the dipoles will be projected to the nearest pint on the gray cortical layer, thus all you deep source will be moved from the deep structure during the computation

I noticed this while reviewing the case for the surface model. I was attempting to create a surface file for the combined deep structures and cortical layer, and then force the vertices within the envelope of this surface. Do you think that would be a workable approach?

I will also give your idea a try. I noticed there is a function tess_refine.m in the anatomy folder. Is this what you had in mind to refine the mesh? It looks simple enough to use, though I'm not sure how I would specify to only refine the mesh locally around the surrounding areas. I suppose you mean to refine only WM and CSF layers, but not necessarily skull or scalp?

Thanks again,

Yes, if you can do that for both the cortical and deep sources, it may works, and still you need to refine in order to reduce the instabilities.

Im not sure if this function support the FEM mesh yet.

I have implemented a version here, few moths ago not fully cleaned, but it may works,

the main change is this function:

with an extra menu item when you click on the FEM mesh, => refine mesh => refine around xxx

At least it will give you the idea how to refine the mesh.