Skip to content
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

Forward problem solution simbio: a discrepancy in our simulations #2423

Open
VlastaKoudelka opened this issue Jun 8, 2024 · 5 comments
Open
Labels

Comments

@VlastaKoudelka
Copy link

VlastaKoudelka commented Jun 8, 2024

Dear Fieldtrip Developers,

Thank you for all your efforts in maintaining Fieldtrip. We have been using Fieldtrip for our research for long time, and now we are facing a discrepancy in our simulations. Here is the context:

  • We have been developing an ESI method for EEG using a surface EEG implant.
  • We develop, simulate, and measure fabricated phantoms to validate the forward and inverse solutions.
  • We investigate various solutions to the forward problem (see this article for more detail).

The issue:

We have a rectangular-shaped phantom with electrodes on the surface and testing dipoles inside the volume conduction models. Through a series of simulations, we conducted the following experiment.

We considered two variants of the model shown in Figure 1:

  1. Model 1 is composed of one layer (one tissue) and is represented by one volumetric mesh (a tetrahedral mesh).
  2. The same model, but with two layers (two tissues) (Model 2), both having the same conductivity (depicted in Figure 1).
  3. Both head models have the same conductivity value of 0.33 S/m.
  4. A testing dipole is located inside the volume (far from the boundaries).
phantom mesh

Fig. 1 A testing model, electrode are marked with red dots
We expected to obtain almost the same results for Models 1 and 2, but this was not the case. Figure 2 and 3 depict leadfields of the two models due to a testing dipole.

image

Fig. 2 Leadfield comparison between MODEL 1 and 2, first half of the electrode set

image (1)

Fig. 3 Leadfield comparison between MODEL 1 and 2, second half of the electrode set

Our question is why the results are so drastically different. We believe that this issue (and its solution) could potentially affect a broader research community.

Thank you for your assistance.

Best regards,
Vlastimil Koudelka

@schoffelen
Copy link
Contributor

without any additional code it is hard for use to comment on this.

are you sure that in your code you enforce SI units prior to passing on the geometries to the lower level simbio code?

also, have you consider to contact the simbio folks as well?

@DavidKuratko
Copy link

Hello,
thank you for your reply.

I uploaded our FT codes to my Google drive:
https://drive.google.com/drive/folders/15Lh9k4kAkaNXB562MVL0zI64D6na2MlG?usp=drive_link

I also added .txt for dipole and electrode positions plus .mat files of 3D models.

There are two FT codes - first one is for Model 1 (one tissue) and the second one for Model 2 (two tissues). Nevertheless, both codes are almost the same (the difference is in tissue assignment - volume.rho).

Thank you for your help in advance.

Best regards,
David Kuratko

@schoffelen
Copy link
Contributor

We don't have the bandwidth to look into this in detail. If I were to diagnose this, I would start off by going through the code line by line, and investigate the equality of the objects along the way. My suspicion is that that simbio compiled code just generates different system matrices, which is not something that FieldTrip can solve.
Once you have confirmed for yourself that it's a simbio issue, I suggest that you reach out to the simbio folks.

@VlastaKoudelka
Copy link
Author

I understand and thank you for the suggestions, we checked everything in the code and finally decided to create the meshes out of the artificially generated MRI scans to rule out the possibility that it is due to our meshes. If you consider this result interresting, I can put new results here ones its computed. If not, you can possibly close the issue now. Thank you.

@schoffelen
Copy link
Contributor

Hi @VlastaKoudelka I spend some time looking at your code, and indeed realized that the base topologies of the meshes are already different (i.e. a different number of vertices + volume elements). I would have assumed initially that you only changed the tissue compartment. As such, one could still have the assumption that - even with a different parcellation of the volume (i.e. differently shaped tetraeders) - the forward models should come out the same. This is beyond our knowledge (and influence sphere) For such a discussion I think you should take it up with the Simbio folks in Muenster, I am pinging @mcpiastra here, who used to work in the group that developed simbio, if she has time she might be able to point you to someone who could/would think along.

By the way, I cleaned up your code a bit, and added a test case where I used the 2-compartment model (the one which has the most vertices and tetraeders), and explicitly defined a single tissue compartment there (setting volume.tissue(:) = 1, volume tissuelabel = {'brain'}. This creates a leadfield that is the same as your '2' compartment model. This suggests indeed that the cause of the observed difference is due to differences in the topology of the mesh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants