Exporting the head model

144 views
Skip to first unread message

Jake E Toth

unread,
Jul 27, 2021, 4:56:00 PM7/27/21
to roast-users
Hello all,

I would like to have access to the head model generated by ROAST.

The issue I am having is the only .msh files generated, even on the example data are for the electrodes, or for the surface of the brain. But I would like the mesh for the surface of the outside of the head.

Please could someone point me in the right direction to access this mesh? I am assuming this mesh is already generated to perform FEM analysis but that it isn't in an easily accessible form as it is not used for visualization by default, but please let me know if I have got that completely wrong!

The alternative is the headreco or mri2mesh functions with SimNIBS but these take 2 and 10 hours respectively.

Kind regards,
Jake Toth

Yu (Andy) Huang

unread,
Jul 28, 2021, 12:37:23 PM7/28/21
to Jake E Toth, roast-users
Hi Jake,

Of course you can access the mesh. If you open the .msh file and go to the Element section you can extract the elements for each specific tissue, for example, skin is 5 (please refer to .msh doc for detailed documentation). You can also find the mesh info in the matlab .mat format.

Hope this helps.

--
You received this message because you are subscribed to the Google Groups "roast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to roast-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/roast-users/782b004e-421f-459f-9376-a1c233080933n%40googlegroups.com.


--
Yu (Andy) Huang, Ph.D.

Research Fellow, Radiology Dept., Memorial Sloan Kettering Cancer Center
Rm. 321-G17P, 321 East 61st Street, New York, NY 10065
Office: 646-608-7608

Research Associate, CCNY-MSK Partnership for Artificial Intelligence
Center for Discovery and Innovation, Rm. 3.320,
85 St Nicholas Terrace, New York, NY 10031
Email: yhua...@citymail.cuny.edu; andypo...@gmail.com
Web: http://www.parralab.org/people/yu-andy-huang/

Jake E Toth

unread,
Aug 3, 2021, 4:01:16 PM8/3/21
to roast-users
Thank you!
Just in case anyone else in the future would like to convert the mesh of the scalp (or any other part) to a .stl file here is the process I am using (this may be obvious to seasoned roasters but took some effort on my part):

The meshes are available in the 'meshByIso2mesh.m' file that is a part of the roast library.

If you try to export the mesh to an stl using another library like stlwrite it won't work so you must use the 
'savestl' function that comes with iso2mesh. I was automatically prompted to download some executables from their github when attempting to use this function. 

Simpleyadd the lines:
indElem = find(elem(:,5) == 5); 
savestl(node(:, 1:3) elem(indElem,:), 'stl_test_file.stl')
To the near the end of meshByIso2mesh.m

Note that the indElem variable represents the indices of the elements for different material types which can be changed to reflect what you would like to make an stl of. For example changing this line 'indElem = find(elem(:,5) == 4); ' will extract just the bone mesh.

More information about saving meshes to different filetypes using iso2mesh can be found here:
http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FunctionList

If you find that the stl file produced has many holes in it you may have to use the
 '[newnode,newface]=meshcheckrepair(node,face);'  command, more info here:
http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ

Software versions used: MATLAB R2020b, Roast 3.0, Windows 10.

Kind regards,
Jake


Yu (Andy) Huang

unread,
Aug 3, 2021, 10:32:52 PM8/3/21
to Jake E Toth, roast-users
Hi Jake,

Thanks so much for the detailed instructions. You're definitely one of the "seasoned roasters" now 😂😂

Thanks again! 

Reply all
Reply to author
Forward
0 new messages