mne-tools / mne-tools/mne-python

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

Open
#10,216 21 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ENH
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files, tests, or entry points are named. Start by comparing the cited methods with felupe, dolfin, and sfepy, and assess whether tissue displacement and conductivity are appropriate for MNE's sEEG/ECoG workflows. Done requires a decided method, dependency, scope, and computational feasibility plan.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.