Giter Site home page Giter Site logo

brain2mesh's People

Contributors

fangq avatar fanyuyen avatar phongatran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

brain2mesh's Issues

An error occurs when running SPM_example_wholehead

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:
1690185451513

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

export Brain2mesh result in ABAQUS

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.

output labels or the data of "elem(:,5)" from surf2mesh

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

The mesh fails with my segmentation from SPM

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

My segmentation
image

My mesh
image

Your mesh
image

install extension

hello
could you help me with installation of this extension on my slicer

Error due to old `tetgen` binary

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

Input meshes segmented by other tools

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

Error when calling brain2mesh

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,

Reducing meshsize

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

Before this change
before

After this change
After

Integration of brain2mesh with brainstorm

@fangq Following your suggestion, I'm checking how we could interface brain2mesh and brainstorm.

First few questions:

  1. Could you share the SPM12 scripts you used in your article for generating the segmentation needed by brain2mesh?
  2. Brain2mesh.m: if v2m is missing you ask for downloading brain2mesh, but you should ask for downloading iso2mesh
  3. imfill/imdilate: Lots of people do not have access to the Image Processing toolbox (outside of North American universities), it would be good to provide alternatives. The Matlab functions imfill and imdilate are probably much more generic than the basic b/w morphological operations you need there. We try to have everything in Brainstorm working without any extra toolbox, for these ones I recoded only what I needed: mri_dilate.m, mri_fillholes.m

@tmedani @juangpc If you have solutions for this, feel free to share.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.