From oupu at dtu.dk Mon Feb 1 09:30:46 2021 From: oupu at dtu.dk (Oula Puonti) Date: Mon, 1 Feb 2021 08:30:46 +0000 Subject: [Simnibs-discuss] Problems with Mac Catalina In-Reply-To: <73C31DEA-B724-4F59-AD43-4B12A0CF1CF3@yahoo.com> References: <73C31DEA-B724-4F59-AD43-4B12A0CF1CF3.ref@yahoo.com>, <73C31DEA-B724-4F59-AD43-4B12A0CF1CF3@yahoo.com> Message-ID: Hi Pedro, Are you 100% sure that your OS is Catalina? In the previous email you sent it seems the SimNIBS code said that it detected Big Sur, see figure below. Best, Oula [cid:181f4bd0-66dc-40ae-8ec5-8568e6664c5a] ________________________________ From: Simnibs-discuss on behalf of Pedro Cunha Sent: Saturday, January 30, 2021 6:46:29 PM To: discuss at simnibs.org Subject: [Simnibs-discuss] Problems with Mac Catalina Hi, I?m a new Simnibs user on a Mac Catalina 10.15.4. After follow the tutorial, the GMesh window doesn?t have the options. And the simulations appear all with a blank screen. Is there an update or something like that? Thanks Pedro Cunha -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pastedImage.png Type: image/png Size: 36464 bytes Desc: pastedImage.png URL: From oupu at dtu.dk Tue Feb 2 11:46:53 2021 From: oupu at dtu.dk (Oula Puonti) Date: Tue, 2 Feb 2021 10:46:53 +0000 Subject: [Simnibs-discuss] Questions regarding the Fsaverage space transformation , and electrode coordinates In-Reply-To: References: Message-ID: <9b791656f73347619de81b6f639ce0ee@dtu.dk> Hi Eden, Fsaverage and the MNI are roughly in the same space, so the coordinates should more or less match. If you want points on the fsaverage surface you can look for the closest node on the surface to your MNI coordinate of interets. W.r.t. the electodes the definitions on how they are setup can be found here: https://simnibs.github.io/simnibs/build/html/documentation/sim_struct/electrode.html and the electrode locations and shapes should be stored in the simulation structure. If you need the full geometrical outline of the electrode on the skin, then you should use the .geo file. Best, Oula ________________________________ From: Simnibs-discuss on behalf of TI, Chun Hang Eden <1155138422 at link.cuhk.edu.hk> Sent: Monday, January 25, 2021 4:42:14 AM To: simnibs-discuss at drcmr.dk Subject: [Simnibs-discuss] Questions regarding the Fsaverage space transformation , and electrode coordinates Dear Sir/Madam, I am currently running simulation analysis using the Fsaverage space provided by SIMNIBS. I want to study the relationship between the distance of electrodes and the electric field on that space. Is there a way to transform the MNI/native coordinates to the Fsaverage coordinates through matlab script? In addition, I am also interested in how electrode geometry and their effect of stimulation. Currently the coordinates of electrodes are stored in .geo file. Is there a way to read these coordinates using MATLAB? Look forward to your reply, and thank you very much. Best regards, Eden -------------- next part -------------- An HTML attachment was scrubbed... URL: From heinesch at rhrk.uni-kl.de Thu Feb 4 15:13:58 2021 From: heinesch at rhrk.uni-kl.de (Christian Heinesch) Date: Thu, 4 Feb 2021 15:13:58 +0100 Subject: [Simnibs-discuss] Questions Message-ID: <202102041414.114EDxru123195@mailgw1.uni-kl.de> Hello, I have now gone deeper into Simnibs, but there are two questions I am currently dealing with, which I hope you could help me with, which would help me a lot further. First I wanted to ask if it is possible to adjust the radius of the six-layer sphere (sphere_midres. msh). I have taken up a lot of time, but I have not found a solution yet. The second question is the subject of the last time, I have now found the data of dA/dt and yet I am not sure how to get to dB/dt with the help of the curvature, do you need the individual triangles or the nodes here? I would very much appreciate an answer. With friendly Christian Heinesch -------------- next part -------------- An HTML attachment was scrubbed... URL: From axelt at drcmr.dk Fri Feb 5 20:36:18 2021 From: axelt at drcmr.dk (Axel Thielscher) Date: Fri, 5 Feb 2021 20:36:18 +0100 Subject: [Simnibs-discuss] Questions In-Reply-To: <202102041414.114EDxru123195@mailgw1.uni-kl.de> References: <202102041414.114EDxru123195@mailgw1.uni-kl.de> Message-ID: Hi, attached is the definition of the sphere. It states the radii of the various shells at the beginning, so you can edit them as you like. Creating a new mesh works as follows: The installation has created a link to the "SimNIBS prompt" next to the icon for the SimNIBS GUI. 1) start a simnibs prompt 2) inside, cd to the directory that contains the sphere.geo 3) run: ??? gmsh -format msh2 -bin -2 -3 -o sphere.msh sphere.geo ??? python 4) inside python , run: m=mesh_io.read_msh('sphere.msh',buffered=True) # for the version 3.2.2 # m=mesh_io.read_msh('sphere.msh') # otherwise m.elm.tag1[m.elm.elm_type == 2] += 1000 m.elm.tag2 = m.elm.tag1 mesh_io.write_msh(m,'sphere.msh') exit() Note: the mesh_io.read_msh can be very slow, so you'll have to wait a bit. Can you remind me again on why you wanted the dB/dt? Best regards, Axel On 2/4/2021 3:13 PM, Christian Heinesch wrote: > > Hello, > > I have now gone deeper into Simnibs, but there are two questions I am > currently dealing with, which I hope you could help me with, which > would help me a lot further. > > First I wanted to ask if it is possible to adjust the radius of the > six-layer sphere (sphere_midres. msh). > > I have taken up a lot of time, but I have not found a solution yet. > > The second question is the subject of the last time, I have now found > the data of dA/dt and yet I am not sure how to get to dB/dt with the > help of the curvature, do you need the individual triangles or the > nodes here? > > I would very much appreciate an answer. > > With friendly > > Christian Heinesch > > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss -- Dr. Axel Thielscher Associate Professor Danish Research Center for Magnetic Resonance Copenhagen University Hospital Hvidovre DK-2650 Hvidovre, Denmark www.drcmr.dk & Department of Health Technology Technical University of Denmark DK-2800 Kgs. Lyngby http://www.healthtech.dtu.dk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- //to mesh a head "sphere" //gmsh -format msh2 -bin -2 -3 -o sphere.msh sphere.geo Mesh.Algorithm3D=4; //1=delaunay (tetgen) and 4=frontal (netgen) Mesh.Optimize=1; Mesh.OptimizeNetgen=1; lc = 2; // this controls the resolution of the mesh r_ven = 20; r_wm = 75; r_gm = 80; r_csf = 85; r_sku = 90; r_ski = 95; //gm Point(101) = {0.0,0.0,0.0,lc}; Point(102) = {r_gm,0.0,0.0,lc}; Point(103) = {0,r_gm,0.0,lc}; Point(104) = {-r_gm,0,0.0,lc}; Point(105) = {0,-r_gm,0.0,lc}; Point(106) = {0,0,-r_gm,lc}; Point(107) = {0,0,r_gm,lc}; //wm Point(111) = {0.0,0.0,0.0,lc}; Point(112) = {r_wm,0.0,0.0,lc}; Point(113) = {0,r_wm,0.0,lc}; Point(114) = {-r_wm,0,0.0,lc}; Point(115) = {0,-r_wm,0.0,lc}; Point(116) = {0,0,-r_wm,lc}; Point(117) = {0,0,r_wm,lc}; //ven Point(121) = {0.0,0.0,0.0,lc}; Point(122) = {r_ven,0.0,0.0,lc}; Point(123) = {0,r_ven,0.0,lc}; Point(124) = {-r_ven,0,0.0,lc}; Point(125) = {0,-r_ven,0.0,lc}; Point(126) = {0,0,-r_ven,lc}; Point(127) = {0,0,r_ven,lc}; //csf Point(131) = {0.0,0.0,0.0,lc}; Point(132) = {r_csf,0.0,0.0,lc}; Point(133) = {0,r_csf,0.0,lc}; Point(134) = {-r_csf,0,0.0,lc}; Point(135) = {0,-r_csf,0.0,lc}; Point(136) = {0,0,-r_csf,lc}; Point(137) = {0,0,r_csf,lc}; //skull Point(141) = {0.0,0.0,0.0,lc}; Point(142) = {r_sku,0.0,0.0,lc}; Point(143) = {0,r_sku,0.0,lc}; Point(144) = {-r_sku,0,0.0,lc}; Point(145) = {0,-r_sku,0.0,lc}; Point(146) = {0,0,-r_sku,lc}; Point(147) = {0,0,r_sku,lc}; //skin Point(151) = {0.0,0.0,0.0,lc}; Point(152) = {r_ski,0.0,0.0,lc}; Point(153) = {0,r_ski,0.0,lc}; Point(154) = {-r_ski,0,0.0,lc}; Point(155) = {0,-r_ski,0.0,lc}; Point(156) = {0,0,-r_ski,lc}; Point(157) = {0,0,r_ski,lc}; //gm Circle(101) = {102,101,103}; Circle(102) = {103,101,104}; Circle(103) = {104,101,105}; Circle(104) = {105,101,102}; Circle(105) = {103,101,106}; Circle(106) = {106,101,105}; Circle(107) = {105,101,107}; Circle(108) = {107,101,103}; Circle(109) = {102,101,107}; Circle(110) = {107,101,104}; Circle(111) = {104,101,106}; Circle(112) = {106,101,102}; //wm Circle(201) = {112,111,113}; Circle(202) = {113,111,114}; Circle(203) = {114,111,115}; Circle(204) = {115,111,112}; Circle(205) = {113,111,116}; Circle(206) = {116,111,115}; Circle(207) = {115,111,117}; Circle(208) = {117,111,113}; Circle(209) = {112,111,117}; Circle(210) = {117,111,114}; Circle(211) = {114,111,116}; Circle(212) = {116,111,112}; //ven Circle(301) = {122,121,123}; Circle(302) = {123,121,124}; Circle(303) = {124,121,125}; Circle(304) = {125,121,122}; Circle(305) = {123,121,126}; Circle(306) = {126,121,125}; Circle(307) = {125,121,127}; Circle(308) = {127,121,123}; Circle(309) = {122,121,127}; Circle(310) = {127,121,124}; Circle(311) = {124,121,126}; Circle(312) = {126,121,122}; //csf Circle(401) = {132,131,133}; Circle(402) = {133,131,134}; Circle(403) = {134,131,135}; Circle(404) = {135,131,132}; Circle(405) = {133,131,136}; Circle(406) = {136,131,135}; Circle(407) = {135,131,137}; Circle(408) = {137,131,133}; Circle(409) = {132,131,137}; Circle(410) = {137,131,134}; Circle(411) = {134,131,136}; Circle(412) = {136,131,132}; //skull Circle(501) = {142,141,143}; Circle(502) = {143,141,144}; Circle(503) = {144,141,145}; Circle(504) = {145,141,142}; Circle(505) = {143,141,146}; Circle(506) = {146,141,145}; Circle(507) = {145,141,147}; Circle(508) = {147,141,143}; Circle(509) = {142,141,147}; Circle(510) = {147,141,144}; Circle(511) = {144,141,146}; Circle(512) = {146,141,142}; //skin Circle(601) = {152,151,153}; Circle(602) = {153,151,154}; Circle(603) = {154,151,155}; Circle(604) = {155,151,152}; Circle(605) = {153,151,156}; Circle(606) = {156,151,155}; Circle(607) = {155,151,157}; Circle(608) = {157,151,153}; Circle(609) = {152,151,157}; Circle(610) = {157,151,154}; Circle(611) = {154,151,156}; Circle(612) = {156,151,152}; //gm Line Loop(213) = {102,108,-110}; Ruled Surface(214) = {213}; Line Loop(215) = {110,103,107}; Ruled Surface(216) = {215}; Line Loop(217) = {-108,-109,101}; Ruled Surface(218) = {217}; Line Loop(219) = {-111,-102,105}; Ruled Surface(220) = {219}; Line Loop(221) = {-105,-112,-101}; Ruled Surface(222) = {221}; Line Loop(223) = {-103,111,106}; Ruled Surface(224) = {223}; Line Loop(225) = {-107,104,109}; Ruled Surface(226) = {225}; Line Loop(227) = {-104,112,-106}; Ruled Surface(228) = {227}; //wm Line Loop(313) = {202,208,-210}; Ruled Surface(314) = {313}; Line Loop(315) = {210,203,207}; Ruled Surface(316) = {315}; Line Loop(317) = {-208,-209,201}; Ruled Surface(318) = {317}; Line Loop(319) = {-211,-202,205}; Ruled Surface(320) = {319}; Line Loop(321) = {-205,-212,-201}; Ruled Surface(322) = {321}; Line Loop(323) = {-203,211,206}; Ruled Surface(324) = {323}; Line Loop(325) = {-207,204,209}; Ruled Surface(326) = {325}; Line Loop(327) = {-204,212,-206}; Ruled Surface(328) = {327}; //ven Line Loop(413) = {302,308,-310}; Ruled Surface(414) = {413}; Line Loop(415) = {310,303,307}; Ruled Surface(416) = {415}; Line Loop(417) = {-308,-309,301}; Ruled Surface(418) = {417}; Line Loop(419) = {-311,-302,305}; Ruled Surface(420) = {419}; Line Loop(421) = {-305,-312,-301}; Ruled Surface(422) = {421}; Line Loop(423) = {-303,311,306}; Ruled Surface(424) = {423}; Line Loop(425) = {-307,304,309}; Ruled Surface(426) = {425}; Line Loop(427) = {-304,312,-306}; Ruled Surface(428) = {427}; //csf Line Loop(513) = {402,408,-410}; Ruled Surface(514) = {513}; Line Loop(515) = {410,403,407}; Ruled Surface(516) = {515}; Line Loop(517) = {-408,-409,401}; Ruled Surface(518) = {517}; Line Loop(519) = {-411,-402,405}; Ruled Surface(520) = {519}; Line Loop(521) = {-405,-412,-401}; Ruled Surface(522) = {521}; Line Loop(523) = {-403,411,406}; Ruled Surface(524) = {523}; Line Loop(525) = {-407,404,409}; Ruled Surface(526) = {525}; Line Loop(527) = {-404,412,-406}; Ruled Surface(528) = {527}; //skull Line Loop(613) = {502,508,-510}; Ruled Surface(614) = {613}; Line Loop(615) = {510,503,507}; Ruled Surface(616) = {615}; Line Loop(617) = {-508,-509,501}; Ruled Surface(618) = {617}; Line Loop(619) = {-511,-502,505}; Ruled Surface(620) = {619}; Line Loop(621) = {-505,-512,-501}; Ruled Surface(622) = {621}; Line Loop(623) = {-503,511,506}; Ruled Surface(624) = {623}; Line Loop(625) = {-507,504,509}; Ruled Surface(626) = {625}; Line Loop(627) = {-504,512,-506}; Ruled Surface(628) = {627}; //skin Line Loop(713) = {602,608,-610}; Ruled Surface(714) = {713}; Line Loop(715) = {610,603,607}; Ruled Surface(716) = {715}; Line Loop(717) = {-608,-609,601}; Ruled Surface(718) = {717}; Line Loop(719) = {-611,-602,605}; Ruled Surface(720) = {719}; Line Loop(721) = {-605,-612,-601}; Ruled Surface(722) = {721}; Line Loop(723) = {-603,611,606}; Ruled Surface(724) = {723}; Line Loop(725) = {-607,604,609}; Ruled Surface(726) = {725}; Line Loop(727) = {-604,612,-606}; Ruled Surface(728) = {727}; Surface Loop(1) = {328,326,316,314,320,324,322,318}; Surface Loop(2) = {228,226,216,214,220,224,222,218}; Surface Loop(3) = {528,526,516,514,520,524,522,518}; Surface Loop(4) = {628,626,616,614,620,624,622,618}; Surface Loop(5) = {728,726,716,714,720,724,722,718}; Surface Loop(7) = {428,426,416,414,420,424,422,418}; Volume(1) = {1, 7}; Volume(2) = {1, 2}; Volume(3) = {2, 3}; Volume(4) = {3, 4}; Volume(5) = {4, 5}; Volume(7) = {7}; Physical Surface(1) = {328,326,316,314,320,324,322,318}; Physical Surface(2) = {228,226,216,214,220,224,222,218}; Physical Surface(3) = {528,526,516,514,520,524,522,518,428,426,416,414,420,424,422,418}; Physical Surface(4) = {628,626,616,614,620,624,622,618}; Physical Surface(5) = {728,726,716,714,720,724,722,718}; Physical Volume(1) = {1}; Physical Volume(2) = {2}; Physical Volume(3) = {3, 7}; // merge csf and ventricles Physical Volume(4) = {4}; Physical Volume(5) = {5}; //Physical Point(1) = {101,102,103,104,105}; //Physical Line(1) = {101}; From DXA869 at student.bham.ac.uk Mon Feb 8 12:25:22 2021 From: DXA869 at student.bham.ac.uk (DXA869 at student.bham.ac.uk) Date: Mon, 8 Feb 2021 11:25:22 +0000 Subject: [Simnibs-discuss] Skull transparency in gmsh Message-ID: <44d720788cee451685e7f49fbbbcddac@student.bham.ac.uk> Dear users, Is there a way to set the skull to transparent in GMSH? I would like to be able to show electrodes and the brain under the skull, in a similar way as in the photo I?ve attached. [Image result for m1 tdcs and high definition vs] Thank you a lot! Davide Aloi, Doctoral Researcher, Centre for Human Brain Health ? University of Birmingham -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 69F2E17B59654889ADDBB7C25EEC919D.png Type: image/png Size: 81700 bytes Desc: 69F2E17B59654889ADDBB7C25EEC919D.png URL: From max.kaiser at student.maastrichtuniversity.nl Fri Feb 12 13:21:09 2021 From: max.kaiser at student.maastrichtuniversity.nl (Kaiser, Max (Stud. FPN / Alumni FPN)) Date: Fri, 12 Feb 2021 12:21:09 +0000 Subject: [Simnibs-discuss] Network Optimisation Avoid Tissues Message-ID: Hi SimNIBS Team, I wanted to use the tDCS network optimisation function for a tACS experiment. When I run the optimization, the electrodes are clustered around the frontal areas, stimulating the eyes substantially. However, the avoid.tissue function only worked for ?single-target? but not for the network-targeted optimisation. Is there a possibility to implement the avoid function for the network optimisation? Thank you in advance! Kind regards, Max. From axelt at drcmr.dk Fri Feb 12 21:56:07 2021 From: axelt at drcmr.dk (Axel Thielscher) Date: Fri, 12 Feb 2021 21:56:07 +0100 Subject: [Simnibs-discuss] Skull transparency in gmsh In-Reply-To: <44d720788cee451685e7f49fbbbcddac@student.bham.ac.uk> References: <44d720788cee451685e7f49fbbbcddac@student.bham.ac.uk> Message-ID: <825b4630-cdbe-9cae-5644-d802029af195@drcmr.dk> Hi, SimNIBS already shows the electrodes transparently for each simulation result. Attached is a script that adds the transparent skin to that. To run it, open a SimNIBS prompt and start python there. You need to update the filename of the mesh in the script. Best, Axel On 2/8/2021 12:25 PM, DXA869 at student.bham.ac.uk wrote: > > Dear users, > > Is there a way to set the skull to transparent in GMSH? > > I would like to be able to show electrodes and the brain under the > skull, in a similar way as in the photo I?ve attached. > > > Thank you a lot! > > Davide Aloi, > > Doctoral Researcher, > > Centre for Human Brain Health ? University of Birmingham > > > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss -- Dr. Axel Thielscher Associate Professor Danish Research Center for Magnetic Resonance Copenhagen University Hospital Hvidovre DK-2650 Hvidovre, Denmark www.drcmr.dk & Department of Health Technology Technical University of Denmark DK-2800 Kgs. Lyngby http://www.healthtech.dtu.dk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fpddepomkmnahjol.png Type: image/png Size: 347244 bytes Desc: not available URL: -------------- next part -------------- # -*- coding: utf-8 -*- """ Created on Fri Feb 12 20:53:27 2021 @author: axthi """ from simnibs import mesh_io fname_msh = 'ernie_TDCS_1_scalar.msh' # extract skin from mesh and write as .geo-file m = mesh_io.read_msh(fname_msh) m = m.crop_mesh(tags=1005) fname_geo = fname_msh[:fname_msh.rfind('_')]+'_skin.geo' mesh_io.write_geo_triangles(m.elm[:,:3]-1, m.nodes[:], fname_geo, name='skin') # add skin-geo file to .opt-file so that is is auto-loaded and displayed last_view_nr = 2 # for standard simulation of E and normE; otherwise adapt fname_opt = fname_msh+'.opt' with open(fname_opt, 'r+') as fp: content = fp.read() content = "Merge \""+fname_geo+"\";\n"+content content = content.replace('View['+str(last_view_nr)+']', 'View['+str(last_view_nr+1)+']') content += "View["+str(last_view_nr)+"].Visible = 1;\n" content += "View["+str(last_view_nr)+"].ShowScale = 0;\n" content += "View["+str(last_view_nr)+"].ColormapNumber = 8;\n" content += "View["+str(last_view_nr)+"].ColormapAlpha = 0.3;\n" fp.seek(0, 0) fp.write(content) fp.close() From axelt at drcmr.dk Wed Feb 17 14:41:28 2021 From: axelt at drcmr.dk (Axel Thielscher) Date: Wed, 17 Feb 2021 14:41:28 +0100 Subject: [Simnibs-discuss] Network Optimisation Avoid Tissues In-Reply-To: References: Message-ID: <5c2b9045-290a-6582-56b5-6111998fbe18@drcmr.dk> Hi, the weights in the eyes are set to zero for TDCS network optimization as standard. There is currently no option to include the eyes into the optimization. Its a good point, and we will try to add it in the future. For now, we can only offer you a hacking solution. In the *opt_struct.py* file in the simnibs installation on your computer, *lines 2258 ff *(see https://github.com/simnibs/simnibs/blob/master/simnibs/optimization/opt_struct.py): ??????? # setting values in eyes to zero ??????? if np.any(self.mesh.elm.tag1 == 1006): ??????????? logger.info('setting target values in eyes to zero') ??????????? if self.lf_type == 'node': eye_nodes=np.unique(self.mesh.elm.node_number_list[self.mesh.elm.tag1 == 1006,:]) ??????????????? eye_nodes = eye_nodes[eye_nodes>0] *field[eye_nodes-1] = 0.0 # node indices in mesh are 1-based* ??????????? elif self.lf_type == 'element': *field[self.mesh.elm.tag1 == 1006] = 0.0* Replace the 0.0 in the bold lines by some negative weights. You will have to manually step through a few values to see which one work well for you. Best, Axel On 2/12/2021 1:21 PM, Kaiser, Max (Stud. FPN / Alumni FPN) wrote: > Hi SimNIBS Team, > > I wanted to use the tDCS network optimisation function for a tACS experiment. > When I run the optimization, the electrodes are clustered around the frontal areas, stimulating the eyes substantially. > However, the avoid.tissue function only worked for ?single-target? but not for the network-targeted optimisation. > Is there a possibility to implement the avoid function for the network optimisation? > > Thank you in advance! > > Kind regards, > Max. > _______________________________________________ > Simnibs-discuss mailing list > Simnibs-discuss at drcmr.dk > https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss -- Dr. Axel Thielscher Associate Professor Danish Research Center for Magnetic Resonance Copenhagen University Hospital Hvidovre DK-2650 Hvidovre, Denmark www.drcmr.dk & Department of Health Technology Technical University of Denmark DK-2800 Kgs. Lyngby http://www.healthtech.dtu.dk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: