-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEM tutorial: Issues to fix #431
Comments
I also posted a draft for the processing script: Please use try to use it to reproduce your computations: For addressing the issues: please post your comments as you work on them, and I will edit the first comment of this thread to keep track of what is left in the todo list. Thanks! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The SimNIBS process works perfectly. If this works for you, we need to understand the differences between our two setups.
In the tutorial I used as a starting point, it was requested to "Refine the registration with head points". This makes accurate localization of the fiducials useless. => "Because we will use the digitized head shape of the subject to refine the MRI/MEG registration, we don't need the position of the fiducials to be very accurate." If you prefer using accurate fiducial positions, we need to disable the automatic registration, and add several pages of instructions to the tutorial to position correctly these fiducials (including the screen capture and positions you shared, description of how you defined these points, etc.) Last option: we include lots of information about the registration (accurate fiducials) just for teaching purposes, AND discard it all by running the automatic registration. However, the main topic of this tutorial is not coregistration, therefore I'd rather avoid adding sub-branches of discussions that are not related with the topic of interest - this would end-up being only "noise" for people interested primarily in FEM modeling. Coregistration is discussed in earlier tutorials, that the user already read... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hi Francois, Can I start editing the tuto or are you still working on it? |
Regarding iso2mesh remeshing: Anyhow, I've tried different combination of surfaces and the remeshing works ok pretty much with any combination of them other than using them all. So I think it is worth trying to modify slightly simnibs values. I'm testing right now. I'll keep posting. |
I am mostly done with all the tutorials: Duneuro, Median nerve, Tensors. I'll work today on the FemMesh tutorial. I hope I'll be done before you start your workday :) |
@fangq FYI We have just released a tutorial based on Brain2mesh: |
Hi @fangq, We have a pair of coregistered T1 and T2 images which we mesh with SimNIBS . We want to remesh them with Iso2mesh. For that we extract the surfaces of whyte, gray, csf, skull and scalp. And we try to call Iso2mesh to remesh them following the tutorial ftadel is mentioning. I see a problem in a When calling Iso2mesh, this call to There are quite a few questions in Matlabcentral regarding We call Hope it helps. |
I'm investigating this issue regarding the re-mesh with iso2mesh, It seems to be related to version of the tetgen, I will give you update asap. Thanks |
@ftadel @juangpc and @tmedani, the status checking was added recently - I haven't encountered strange status code like this before, but happy to take a look. can you set a break-point at the system call, evaluate the string parameter feed to system, which is basically a shell command, copy paste that command in a terminal and run it, what do you see? if it still looks strange, please send me all input variables and full command to that |
If you do that, the command executes with normal output (not empty) and exit status (not floating point).
This is the output:
However the |
the above log looks like incomplete - likely tetgen crashed in the middle, can you type my suspicion is that this is related to 32bit/64bit executable issue, which was fixed last year: fangq/iso2mesh#11 if you run iso2mesh on a 64bit windows machine, the tetgen executable ( the part that handles the exe search fallback is here PS: this issue was also reported previously here: fangq/iso2mesh#43 |
on a side note, I'd like to understand the rationales for a user to choose the combination of SimNIBS+iso2mesh remeshing - what is the remeshing step trying to achieve? on a related question - from the tutorial SimNIBS meshing can take 4-5 hours and the mesh is very dense, why not use brain2mesh? any issue for brain2mesh's outputs? I am asking because I want to see what aspect that brain2mesh can be further improved (at least matching the output quality of SimNIBS), while giving full control on mesh density. |
I get no return value. Not sure if it is my terminal though.
Could it be that we're downloading an outdated version? Brainstorm downloads from Iso2mesh's releases the following one: https://github.com/fangq/iso2mesh/releases/tag/v1.9.2 |
If I manually clone Iso2mesh's updated repo and install it for Brainstorm to use it. I'm able to get a different output. The error I get now is: I can remesh no problem all surfaces except the scalp. So it seems there might be some problem there. |
Isn't it necessary to have matlab's Image processing toolbox installed? |
Hi @fangq and thanks for your feedback and advice.
indeed we have discussed this issue some time ago but it appears in some cases that I'm also investigating.
This is related to two main reasons,
|
@fangq Could you recompile a newer version, as you did last year? |
done, see
from the error message, looks like the input surface contains self-intersections, there must be something in the earlier steps that has caused this. please check
indeed - the only thing I need are
did you mean brain2mesh created surfaces have holes? that would be unexpected, I would love to get a reproducer and test
in brain2mesh, only wm/gm are required, all other segments (csf, bone, scalp) are optional, see fangq/brain2mesh@3e88bd8 again, I am aware of the output quality differences between SimNIBS and SPM seg derived brain2mesh meshes, just want to if there is anything easy to fix |
Thanks! @juangpc @tmedani It solves the remeshing issue with the tutorial! (at least on my computer)
No, brain2mesh fills entirely the head volume. SimNIBS (air cavities in the anterior part of the skull): Surfaces extracted and remeshed with Iso2mesh (no more holes):
I can't judge the quality of the tetrahedral mesh. From a more general point of view in Brainstorm source estimation: SimNIBS has the advantage of running a full CAT12 pipeline, which generates good quality triangular meshes of the grey matter. @juangpc @tmedani Maybe you can elaborate on the choice of recommending SimNIBS over Brain2mesh+CAT12? |
Hi all, Thanks, @fangq, and @ftadel for solving the meshing issues
I will check it on my computer as well asap.
@ftadel do you mean that Duneuro works even on the model with holes?
We have already integrated brain2mesh within brainstorm and tested in some case, however since brain2mesh need a segmented volume as an input, we need first to segment the MRI, and from our testings, we have observed bad segmentation outputs in some cases which lead to a bad mesh. However since simnibs has the full process with integrated methods that correct the segmentation, so in most cases, it has a better mesh, this was the main reason why we have recommended SimNibs for now. So, if we have a robust method for segmenting the whole, then of course brain2mesh is the straightforward method to recommend since it's Matlab based, and it can be much faster. |
Actually, I realize that I haven't let the MEG FEM run on my old laptop until the end, so I don't know... |
@tmedani |
Hi @ftadel, Thanks for checking on that. I jumped to something else, but I will be back to that and complete it. |
sqrt((x1-x2)^2+(y1-y2)^2+(z1-z2)^2)
) from the Matlab command line to get the exact distance (screen capture of the Matlab command window).=> Must be edited, most options are not documented.
The text was updated successfully, but these errors were encountered: