[Simnibs-discuss] Normal component E-field in Matlab after optimization

fangc fangc at drcmr.dk
Wed Jun 9 10:56:55 CEST 2021

Dear Steven,

The attribute 'map_to_surf' will map your results to the gray matter 
central surface and not give you the normal component of the E field. 
What you want to do might be a little post-processing. I do not know 
which language you use for your development, but in python you can 
simply do the following, for example, if you have a mesh in FsAverage 

field_name = 'E_normal'

You can find more details here:

It also has a Matlab example for the same purpose. Good luck. And please 
let us know if you have further questions.


On 2021-06-08 12:38, Beumer, Steven wrote:
> Dear SimNibs team,
> I am writing a little MATLAB app to do optimizations in SimNibs via a
> GUI, which is going very well.
> In the GUI I would like to plot the fields and the histogram, which I
> do via the standard data reading scripts, however I have troubles
> getting the normal component of the E-field.
> I tried giving the optimization structure a map_to_surf = true
> attribute, which does not work. Is there a way to get the normal
> component without doing the simulation afterwards with the optimized
> electrodes?
> Kind regards and a lot of thanks in advance,
> Steven Beumer
> PhD student at the Eindhoven University of Technology
> _______________________________________________
> Simnibs-discuss mailing list
> Simnibs-discuss at drcmr.dk
> https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss

More information about the Simnibs-discuss mailing list