question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ENH] Finite Element Modeling for Tissue Displacement by Intracranial Electrodes and Conductivity

See original GitHub issue

This 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:open
  • Created 2 years ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
sarangnemocommented, May 11, 2022

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.

1reaction
agramfortcommented, Jan 20, 2022

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

Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

SEEG source localization: how is stc_near_sensors different?
Hi Yoga, stc_near_sensors take a space of source vertices and uses the center of an intracranial electrode contact to find the nearest vertex...
Read more >
Finite Element Modeling of Magnitude and Location of Brain ...
A three-dimensional finite element model was used to simulate the probe-brain tissue interface and evaluate the strains formed in the tissue ...
Read more >
Validating Patient-Specific Finite Element Models of Direct ...
The objective of this work was to validate patient-specific FEM models of DECS that account for brain shift and test model accuracy as...
Read more >
Finite Element Electrode and Individual Patient Modeling to ...
Anisotropic Brain Tissue Conductivity Estimation . ... finite element model of a Utah array microelectrode in neural tissue was coupled with a multi-....
Read more >
Standard Non-Personalized Electric Field Modeling of Twenty ...
An approach to calculate the generated electric field is the computational finite element method. This method enables simulation of the current spread and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found