[Simnibs-discuss] Normal component E-field in Matlab after optimization
s.beumer at tue.nl
Wed Jun 9 12:58:01 CEST 2021
Dear Fang and the SimNibs team,
Thank you for your answer, I understand the error in my reasoning indeed with map_to_surf, I use Matlab for my development and I would like to have my mesh in FsAverage indeed. The problem that I have though is that I would like to have this after an optimization call, which also returns the fields, instead of after a tDCS simulation.
Using the following does not yield the mapped fields (probably because opt_struct doesn't have those options) :
S = opt_struct('TDCSoptimize');
S.map_to_fsavg = true;
S.map_to_mni = true;
A workaround would be to simulate the optimized structure with the flags put to true, however I was curious if there would be a more elegant solution to this.
Is there a solution for this or should I go for the workaround?
Kind regards and many thanks for your help,
From: fangc <fangc at drcmr.dk>
Sent: Wednesday, June 9, 2021 10:57 AM
To: Beumer, Steven <s.beumer at tue.nl>
Cc: simnibs-discuss at drcmr.dk
Subject: Re: [Simnibs-discuss] Normal component E-field in Matlab after optimization
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
> 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
More information about the Simnibs-discuss