[ENH] Finite Element Modeling for Tissue Displacement by Intracranial Electrodes and Conductivity
See original GitHub issueThis is a bit of a two-for-one but the last major things that I can think of that are specific to sEEG/ECoG which are not available currently in MNE are modeling tissue displacement from the electrodes and conductivity to determine which tissues contribute to a recording contact.
For the first one, the idea would be to have a mapping like the symmetric diffeomorpic registration that warped an image around contacts present in the CT and could be applied to any Freesurfer image (e.g. an aseg
file).
For the second one, I’m not as sure exactly how this would work depending on the referencing scheme, but my impression is that it would be similar to what is done in https://github.com/simnibs/simnibs.
For both, this would potentially mean adding an optional finite element library dependency, but this field seems to be mostly proprietary closed source although not all. The one that seems lightweight enough and promising based on their documentation to me is https://github.com/adtzlr/felupe. It’s not that others like dolfin
or https://sfepy.org/doc-devel/index.html aren’t likely capable of doing this (probably with a few PRs), I like felupe
because it doesn’t have a text-based model input and deals directly with numpy
arrays. I have one discussion started that I need to follow up on https://github.com/adtzlr/felupe/discussions/137, they have been super helpful in the one interaction.
These papers have methods descriptions that apply to the problem: https://doi.org/10.1371/journal.pone.0242704 and https://doi.org/10.1016/j.media.2019.06.004. These are great but it’s a bit confusing to me that a pretty complex method would be shared entirely in descriptions of the algorithm with no code. I’m not sure how hard it would be to implement but it would have been a lot easier if it could just be translated rather than written from scratch. Maybe it would be worth asking the authors, it’s probably written in MATLAB, but I doubt that would work well with relicensing.
I haven’t done a ton of this, but it doesn’t seem like so much computations to find these goals to a good approximation but all the solutions with FEM involve inverting a global stiffness matrix which is large and sparse and takes a lot of time and RAM. Possibly the element-free Galerkin method might be more computationally efficient with similar results. I think for a first pass it might be fine to have a reasonable approximation which can then be iterated on and tested. Since this isn’t really the main focus of intracranial analysis, it would be really nice if it took under an hour to compute. I haven’t gotten too far into figuring out what this would take to do (i.e. a couple-week project or full summer), these are just my thoughts from my first impression.
I think the main questions are:
- Is this the best way to go about determining which tissues are contributing to an intracranial recording?
- Is this something that is appropriate/not too big and too computationally intensive for testing to live in the main MNE-Python repository?
- Is there a dependency that someone is confident is the best way to implement FE things? And, relatedly, would this be incredibly onerous to implement in
numpy
/scipy
so that’s off the table? - Is the element-free Galerkin method easy enough to code that it might be lower computation and thus fit the needs of MNE users better?
@larsoner mentioned that maybe @agramfort might have some interest in this potentially for reviewing some PRs.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (15 by maintainers)
Top GitHub Comments
You may want to check out the new FEM package DUNEuro, from the group that previously developed SimBio. They’ve made Python bindings, and it seems their Matlab bindings have already been integrated into FieldTrip and BrainStorm.
I’ve done BEM/FEM in the past with custom C++ code. I’ve never used these libs but I will be happy to review/help with what I know.
As it’s learning while walking maybe you could start by working on a separate repo before considering contributing this to MNE
my 2c