Skip to content

SEEG: Add infinite homogeneous medium headmodel#919

Merged
rcassani merged 17 commits into
brainstorm-tools:masterfrom
Edouard2laire:SEEG-headmodel
May 27, 2026
Merged

SEEG: Add infinite homogeneous medium headmodel#919
rcassani merged 17 commits into
brainstorm-tools:masterfrom
Edouard2laire:SEEG-headmodel

Conversation

@Edouard2laire

@Edouard2laire Edouard2laire commented May 9, 2026

Copy link
Copy Markdown
Collaborator

Hello,

This PR adds a very simple head model for SEEG that assumes an infinite medium with uniform conductivity (sigma).

This is described in https://onlinelibrary.wiley.com/doi/epdf/10.1002/hbm.23127 (equation 4) with a tweak to limit instability close to the electrodes (eq 5).

Although I think we will slowly move toward more complex FEM models, having this simple model in Brainstorm will enable easier comparison of the different models.

Todo:

  • Add option for the model: min_distance and conductivity
  • Test on volumetric head model

@rcassani

Copy link
Copy Markdown
Member

You may want to talk with Takfarinas as he is working in related (and potentially) overlapping) developments

FYI @tmedani

@Edouard2laire

Copy link
Copy Markdown
Collaborator Author

Tested on volume. Works fine as far i know.

image

@rcassani, I think it's ready for review, most importantly for the user-interface part. Regarding the name, uniform may not be the best. I was thinking "0-shell" model might work well as an 'extension' to the 1-shell EEG model. (Here, we don't model the skull. What do you think?

@tmedani, what do you think about this?

Edouard

@Edouard2laire Edouard2laire marked this pull request as ready for review May 11, 2026 23:58
@tmedani

tmedani commented May 12, 2026

Copy link
Copy Markdown
Member

Hi @Edouard2laire, @rcassani

This is indeed a good feature for a simplified version of the sEEG LF, similar to the sphere model for EEG/MEG. While we would recommend using BEM/FEM in such cases, this feature can be used for comparison and validation. I think it is nice to have it within BST.

@rcassani rcassani requested review from rcassani and tmedani May 19, 2026 13:25
@tmedani

tmedani commented May 19, 2026

Copy link
Copy Markdown
Member

Hi team,
It is on my list; I'll review it asap.

@tmedani

tmedani commented May 22, 2026

Copy link
Copy Markdown
Member

Hi @Edouard2laire
The code works fine, needs some cleanup before merging, and probably @rcassani will make some modifications.

Have you had a chance to compare the LF of this method with BEM/FEM?

I just did one quickly, FEM vs Inf
image

Looks okay, I'll need to run it in a more refined model + source space.

Also, I haven't checked the paper, but does the formulation assume infinite refElec?

@Edouard2laire

Edouard2laire commented May 22, 2026

Copy link
Copy Markdown
Collaborator Author

Hi,

Have you had a chance to compare the LF of this method with BEM/FEM?

No, I didn't. Thanks a lot for having done the comparison.

Also, I haven't checked the paper, but does the formulation assume infinite refElec?

In the paper, they used an averaged reference. But based on my understanding of how forward models are stored in Brainstorm, I assumed infinite refElec in the code, as the model can then be re-referenced before being used. If we have an explicit reference as suggested in #893 then it should be relatively easy to add.

@rcassani

Copy link
Copy Markdown
Member

@Edouard2laire, @tmedani, minor changes were made:

  • Move the interactive parts to panel_heademodel
  • Improve doc string
  • Use functions compatible with older versions of Matlab

Functionally, it looks good to be merged.

Regarding the name, it seems uniform medium is quite vague, while Infinite homogeneous medium is quite long.

Would you consider the label Homogenous medium as a good trade off to be present in the GUI?

@Edouard2laire

Copy link
Copy Markdown
Collaborator Author

Would you consider the label Homogenous medium as a good trade off to be present in the GUI?

Yes, that seems reasonable to me.

What is your take on the reference system? Is it correct to use an infinite reference here, or should we use an average reference or something else?

@rcassani rcassani changed the title [SEEG] Add infinite conductor headmodel SEEG: Add infinite homogeneous medium headmodel May 27, 2026
@rcassani

Copy link
Copy Markdown
Member

Is it correct to use an infinite reference here, or should we use an average reference or something else?

AFAIK we can keep the resulting G with the infinite reference. When this G is used to compute the inverse model, then the average reference is applied. This is the approach taken for EEG head models

% ALL MOVED TO PROCESS_INVERSE
% % ===== EEG AVERAGE REFERENCE =====
% if ~isempty(iEeg)
% Gain(iEeg,:) = bst_bsxfun(@minus, Gain(iEeg,:), mean(Gain(iEeg,:)));
% end

@Edouard2laire

Copy link
Copy Markdown
Collaborator Author

Tested. it seems to be working fine

Comment thread toolbox/forward/bst_seeg_homogeneous.m Outdated
@rcassani rcassani merged commit 44c2813 into brainstorm-tools:master May 27, 2026
@Edouard2laire Edouard2laire deleted the SEEG-headmodel branch May 27, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants