-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
WIP, ENH: Add FSL betsurf BEM generation #8840
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
Conversation
|
@larsoner I think we cannot decouple this new feature from the BEM solver as meshing issues and meshes too close from each other will blow up the numerics in the BEM. I don't think we have any safeguard for this in the BEM code. Basically looking at the images is not enough to assess if it's good enough for source imaging. my 2c |
Maybe good enough for MEG-only / 1-layer, i.e., only care about the inner skull surface being more correct than But I see what you're saying. I know there is some code floating around for ensuring meshes have some sufficient spacing. What would you consider the minimum for our BEM solver? 1mm? 3mm? |
|
Basically looking at the images is not enough to assess if it's good
enough for source imaging.
Maybe good enough for MEG-only / 1-layer, i.e., only care about the inner
skull surface being more correct than mri_watershed?
but for 1 layer the code we have is already quite good no?
But I see what you're saying. I know there is some code floating around
for ensuring meshes have some sufficient spacing. What would you consider
the minimum for our BEM solver? 1mm? 3mm?
rule of thumb is that the triangles edge sizes should be comparable to the
distance between meshes and between inner surface and the dipoles in source
space
|
Often the Arguably people should correct their This is not my area of expertise, though, it's entirely possible that these bumps don't matter or are somehow correct/reasonable, though it doesn't look like it to me by eye, and doesn't match what FieldTrip + SPM produces for the inner skull (ever) or what betsurf produces (in most cases).
Nice, this gives a good way of quantifying how well these meshes would be usable in our source localization. And I have a bunch (~100 or so?) of adult MRIs with FLASH so I could actually compare FLASH/watershed/betsurf/FieldTrip+SPM (and anything else) directly several methods in principle. Maybe I'll just start with my own MRI. I am "three" in the images above, but I'm sure you recognized me from the high-fidelity outer_skin surface betsurf produced :) @agramfort concretely would it make sense to start in a separate PR with some metrics to quantify 3-layer BEM mesh quality in terms of 1) mesh-to-mesh spacing, 2) within-mesh neighbor vertex spacing, 3) and inner-skull-to-white-surface spacings? |
|
+1 to have a function that summarizes a BEM quality. Then we can call this
function on many subjects
and see how it compares.
… |
|
Yikes that's a lot of conflicts 😨 I'll close for now but hopefully I'll find time to come back to this at some point! |
Closes #7232
Gives us another way to compute meshes. They are not perfect but work for at least some subjects. For example the defaults (use
fslfor everything) for two subjects are not perfect, but if we pass--brainmask brainmask.mgzto use the FreeSurfer-computed (and possibly manually fixed) brainmask then we're at least as good aswatershed_bemat least for the skull surfaces (white is the original brain surface from the marching cubes):I don't know why the nose gets killed in all of these but it's hopefully okay?
Without supplying
--brainmaskit fails on some pretty spectacularly likesample, probably because the T1 is not normalized howbetexpects:It takes about a minute if you use flirt, but if you pass
-tto use the FreeSurfer registration it takes about 20 seconds.Need to document and add
skimageas a dependency for this, at least when usingbrainmask, because it uses their marching cubes algorithm. Eventually we could add things like Gaussian smoothing (scipy.ndimage) before marching cubes and/or Lapalacian filtering of the tesselated meshes (trimesh) but so far it doesn't seem to help much here.Also need to add a test (maybe speed up the
fsaverageone) that uses-t/talairach, and one that usesbrainmask.