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

fangc fangc at drcmr.dk
Wed Jun 16 11:31:32 CEST 2021


Dear Steven,

You will need to run the simulation again. SimNIBS aims to facilitate 
the use of individualized stimulation modeling, which leads to the fact 
that the Leadfield is calculated at an individual subject level, not on 
the standard spaces, such as FreeSurfer’s FsAverage. So you could simply 
rerun the simulation to get the fields. Hope it helps.

Kind regards,

Fang

On 2021-06-09 12:58, Beumer, Steven wrote:
> 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,
> Steven
> 
> -----Original Message-----
> 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
> 
> 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
> space:
> 
> field_name = 'E_normal'
> results_fsavg.field[field_name].value
> 
> You can find more details here:
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsimnibs.github.io%2Fsimnibs%2Fbuild%2Fhtml%2Ftutorial%2Fadvanced%2Fgroup_analysis.html%3Fhighlight%3Dnormal&data=04%7C01%7C%7Cd72f4185a1954759b71208d92b2488d8%7Ccc7df24760ce4a0f9d75704cf60efc64%7C1%7C1%7C637588258179721089%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=eYAXvGd%2FbxSvJnXoIoBUbF6IHgv1fVQR%2FmBiY9HoQDk%3D&reserved=0
> 
> It also has a Matlab example for the same purpose. Good luck. And
> please let us know if you have further questions.
> 
> Best,
> Fang
> 
> 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://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.drcmr.dk%2Fmailman%2Flistinfo%2Fsimnibs-discuss&data=04%7C01%7C%7Cd72f4185a1954759b71208d92b2488d8%7Ccc7df24760ce4a0f9d75704cf60efc64%7C1%7C1%7C637588258179731041%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=%2FtZczCRJ8UU0sOp3cZdRWr8jzhiJIX%2BZkGm3SqLXe8k%3D&reserved=0
> _______________________________________________
> 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