fangq / brain2mesh Goto Github PK
View Code? Open in Web Editor NEWBrain2Mesh - a one-liner for high-quality brain mesh generation
Home Page: http://mcx.space/brain2mesh
License: Other
Brain2Mesh - a one-liner for high-quality brain mesh generation
Home Page: http://mcx.space/brain2mesh
License: Other
Dear developers,
First of all, thank you very much to your team for sharing this tool
I had problems trying to model my brain with brain2mesh. I first installed the required toolkit, I ran check_brain2mesh_dependency, and then I ran SPM_example_wholehead with the following:
,
In addition, I try to import the generated brain model into comsol for simulation. I also want to know how to control the size of the mesh. In addition, is there a public 3D brain model (step or mesh type file)?
Looking forward to your reply!
best,
jiangyu
Hello
I have just run Brain2mesh and now I am going to send result to Abaqus , can you help me with it, please.
any suggestion is appreciate highly.
Hi,
I use iso2mesh to generate volume mesh from surfaces mesh with differents regions,
let say in the surface I have 3 regions [1 2 3];
When I use the surf2mesh function, I get the three regions, which is great,
but the labels are not sorted in correct way,
From differents situation I get labels with [0 2 3] or [3 0 1]...
So at each time I need to check manually the label and the region.
Do you know how I can make this process automatically, I mean, how I can control the output labels
region 1 ==> 1
region 2 ==> 2
region 3 ==> 3
...
Thank you for your helps
Bests
Takfarinas
Dear brain2mesh
I have been trying to use your program to create meshes from an MRI segmented using SPM12, however, the results seem very wrong ('rotated', in fact). I have followed your guide in spm_seg_with_brain2mesh.pdf which works fine. Could you perhaps tell me what might be wrong? I have included screenshots of the segmentation in SPM, as well as the output from brain2mesh for both my segmentation and the output from following your guide.
Additionally, I get the following error when trying to include the skull tissue type in brain2mesh:
Error using plot3 There is no FaceColor property on the Line class.
Error in plotmesh (line 145) h=plot3(node(idx,1),node(idx,2),node(idx,3),opt{:});
Error in SPM_example_brain (line 34) plotmesh(node,elem(elem(:,5)==2,:),'x>90 | z<130','FaceColor',[1 1 0.9]) %%bone
I suppose this might be due to a difference in matlab version? I am using MATLAB R2019b.
I hope you can help.
Best
Rebina
hello
could you help me with installation of this extension on my slicer
Hello
Is there any way to export built model by Brain2mesh to Abaqus?
Thank you in advance for your help.
Not sure if the issues belongs here or in iso2mesh
In some places brain2mesh.m
(example) calls meshabox.m
which in turns calls surf2mesh.m
without method
thus the default 'tetgen'
is used. This causes an error as the old binary is used.
The error is solved by replacing the old binary, tetgen.mexa64
, with a symbolic link to tetgen1.5.mexa64
Hi @fangq,
Could you please provide the scripts that accommodate the combination of segmented surface meshes, such as those produced in FreeSurfer and Cat12, as part of the input data?
Thank you in advance.
Bset regards,
Yichuan Jiang
Hi @fangq,
I'm trying to run the bran2mesh function on a segmented MRI into 5 tissues,
but I'm not able to make it work as expected, here is my example :
the link below contains the "tissues" data which is the segmentation of the MRI into 5 main tissues, ordered from inner to outer (label 1 to 5)
wm(1), gm(2), csf(3), skull(4) and scalp(5)
here is the code
load('tissues') % download from this link https://www.dropbox.com/t/XBpvzMCBg9acTGTB
seg2 = [];
names={'wm','gm','csf','skull','scalp'};
for i = 5:-1:1
seg2.(names{i}) = uint8(tissues.Cube==i);
end
cfg.dotruncate = 1;
[node,elem,face] = brain2mesh(seg2,cfg);
here is the output
>> cfg.dotruncate = 1;
[node,elem,face] = brain2mesh(seg2,cfg);
95 segname=fieldnames(density);
extracting surfaces from a volume ...
region 1 centroid : 130.000000 91.666667 1.333333
processing threshold level 1...
Surface Mesh Extraction Utility (Based on CGAL 3.6)
(modified for iso2mesh by Qianqian Fang)
http://iso2mesh.sf.net
RNG seed 1648335518
set initial mesh size to 50
Refining... maximum node number is set to 100000
reach maximum node limit, element angular bound may not satisfied
done.
Final number of points: 100000
surface mesh generation is complete
extracting surfaces from a volume ...
region 1 centroid : 119.500000 21.666667 1.333333
processing threshold level 1...
Surface Mesh Extraction Utility (Based on CGAL 3.6)
(modified for iso2mesh by Qianqian Fang)
http://iso2mesh.sf.net
RNG seed 1648335518
set initial mesh size to 50
Refining... maximum node number is set to 100000
done.
Final number of points: 40491
surface mesh generation is complete
extracting surfaces from a volume ...
region 1 centroid : 117.500000 18.666667 1.333333
processing threshold level 1...
Surface Mesh Extraction Utility (Based on CGAL 3.6)
(modified for iso2mesh by Qianqian Fang)
http://iso2mesh.sf.net
RNG seed 1648335518
set initial mesh size to 50
Refining... maximum node number is set to 100000
reach maximum node limit, element angular bound may not satisfied
done.
Final number of points: 100000
surface mesh generation is complete
extracting surfaces from a volume ...
region 1 centroid : 116.000000 16.666667 1.333333
processing threshold level 1...
Surface Mesh Extraction Utility (Based on CGAL 3.6)
(modified for iso2mesh by Qianqian Fang)
http://iso2mesh.sf.net
RNG seed 1648335518
set initial mesh size to 50
Refining... maximum node number is set to 100000
done.
Final number of points: 19658
surface mesh generation is complete
generating tetrahedral mesh from closed surfaces ...
creating volumetric mesh from a surface mesh ...
volume mesh generation is complete
extracting surfaces from a volume ...
region 1 centroid : 114.000000 14.666667 1.333333
processing threshold level 1...
Surface Mesh Extraction Utility (Based on CGAL 3.6)
(modified for iso2mesh by Qianqian Fang)
http://iso2mesh.sf.net
RNG seed 1648335518
set initial mesh size to 50
Refining... maximum node number is set to 100000
done.
Final number of points: 1835
surface mesh generation is complete
generating tetrahedral mesh from closed surfaces ...
creating volumetric mesh from a surface mesh ...
volume mesh generation is complete
Error using surfboolean (line 188)
surface boolean command failed:
cd "C:\Users\33649\AppData\Local\Temp\iso2mesh-medani\" && "G:\My Drive\GitFolders\GitHub\iso2mesh\bin\cork.exe" -first
"C:\Users\33649\AppData\Local\Temp\iso2mesh-medani\pre_surfbool1.off" "C:\Users\33649\AppData\Local\Temp\iso2mesh-medani\pre_surfbool2.off"
"C:\Users\33649\AppData\Local\Temp\iso2mesh-medani\post_surfbool.off" -1648335518
ERROR: error at c:\users\fangq\cork\src\mesh\mesh.isct.tpp, line #1063: Ran out of tries to perturb the mesh
Error in brain2mesh (line 235)
[final_surf_n,final_surf_f] = surfboolean(nbox,fbox(:,[1 3 2]),'first',surf_n,surf_f);
As usual, I will appreciate it If you can orient me to solve this issue.
Thank you in advance for your help.
best,
Dear Brain2mesh
As I understand it, openmeeg recommends the meshsize to be approximately 600 to 800 points per surface(https://openmeeg.github.io/tutorial.html). Without adjusting any parameters in cfg, I get a size between approx. 100000 and 900000. I have tried setting 'cfg.maxnode' to 1000. However, the number of nodes is still very high. Could you perhaps help me? I have included screenshots of the size of the elements per surface before and after this change .
Best wishes,
Rebina
@fangq Following your suggestion, I'm checking how we could interface brain2mesh and brainstorm.
First few questions:
@tmedani @juangpc If you have solutions for this, feel free to share.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.