[Simnibs-discuss] Questions

Axel Thielscher axelt at drcmr.dk
Fri Feb 5 20:36:18 CET 2021


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: <https://mailman.drcmr.dk/pipermail/simnibs-discuss/attachments/20210205/7c47d786/attachment-0001.html>
-------------- 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};





More information about the Simnibs-discuss mailing list