Removing a lesioned area

Hi @Francois. I am not convinced that the approach you proposed is working as expected. Computing the largest relative difference between the lead field gains obtained with the original mesh (x) and the mesh missing a large lesion (\hat{x}) only for the vertices present in both mesh using the formula

image

I get a maximal error of 5e-12, which seems to me to be only numerical accuracy errors. A similar approach in MNE-Python gives some hot spots with relative differences up to about 1.5. Although, I would expect some stability in the estimation algorithm, I would also expect that a big chunk of cortex missing would change the gains in the rest of the cortex. Any advices?

I get a maximal error of 5e-12, which seems to me to be only numerical accuracy errors. A similar approach in MNE-Python gives some hot spots with relative differences up to about 1.5.

Does this refer to the Gain matrix or the leadfield sensitivity, as shown in the screen captures above?

Can it be that some of the leadfield post-processing (depth weighting, dipoles orientations, whitening) is done at the time of the inverse computation in Brainstorm, while it is done before your tests in MNE-Python?
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/inverse/bst_inverse_linear_2018.m#L606

I would expect some stability in the estimation algorithm, I would also expect that a big chunk of cortex missing would change the gains in the rest of the cortex.

The Gain matrix indicates how each source dipole independently projects on the sensors. I'm not sure I understand why you would expect it to be different for a dipole A depending on whether there is an adjacent dipole B or not.
In my understanding, the gains in the Brainstorm "headmodel" file should be identical (minus numerical approximations) for a dipole that is present in the two files, even if most of the rest of the cortex is missing in one of the two.

@John_Mosher @Sylvain @tmedani
Am I missing something?

Hi Francois,

Is that possible to use an MRI mask as scout to remove when using volume models?

The Gain matrix indicates how each source dipole independently projects on the sensors. I'm not sure I understand why you would expect it to be different for a dipole A depending on whether there is an adjacent dipole B or not.

Hmm... right... I think you are right with respect to the lead field. Sorry, I did not take enough time to think this through and I had more in mind the inverse modeling (i.e., how the sources for a single dipole will be different if you add another dipole because the second dipole will now be responsible for some of the EEG activity that was attributed to the first dipole originally... but you are right, the lead field is independent of all that). This kind of validation of the effect of a lesion would need to be more on sources distribution than the lead field, I suppose. Arguably, though, a big chunk of missing cortex would also impact the head model and, hence, the lead field, but it is probably something that would be better captured by a FEM than a BEM model (much as the effect of ventricles are)... I'll do some further checks. Thanks @Francois for the input.

Jumping in the discussion a bit late, sorry: a lesion would alter the head model/gain vectors of sources if its conductivity parameters are different from surrounding tissues ; for instance if this is a resected portion of cortex, then its conductivity is that of CSF. A FEM/BEM model can explicitly take these aspects into account in the head model, again, if the region in question is properly delineated. See this recent paper: https://pubmed.ncbi.nlm.nih.gov/35781078/

1 Like

From the scout tab, you can load a MRI binary mask or a labelled volume parcellation as surface or volume scouts using one of the file formats "Volume mask or atlas" in the scout import file selection window.

These are research considerations for new possible tools to be developed in the future for MEG/EEG forward modeling. At the present time, I don't have any solution to suggest for handling this with the current OpenMEEG BEM workflow in Brainstorm.
It would be easier to think about with the DUNEuro FEM approach, but I wouldn't know how to add easily the lesion masks in the tetrahedral FEM mesh - hopefully we'll get there at some point.

This looks like a way to do it, with SimNIBS, by implementing the mask in the model: add_tissues_to_upsampled — SimNIBS 4.0.0 documentation

Thanks. I added this link to our infinite todo list :slight_smile:
https://neuroimage.usc.edu/brainstorm/Next#Forward_modeling

1 Like

Something I would change is the way brainstorm deals with tissue names when imported from SimNIBS4. In in_tess_simnibs.m, line 60 and below, the function assigns some default names to the tissues, but this won't work with exceptions such as including an extra tissue, or for instance having the lesion instead of "electrodes".


   case 'SIMNIBS4'
        % Relabel the electrodes and gel
        MeshMat.Tissue(MeshMat.Tissue==100) = 11;
        MeshMat.Tissue(MeshMat.Tissue==500) = 12;
        % Default tissue labels (from file: final_tissues_LUT.txt)
        MeshMat.TissueLabels = {'white', 'gray', 'csf', 'skull', 'scalp', 'eyes', 'compact', 'spongy', 'blood', 'muscle', 'electrode', 'gel'}; % I WOULD CHANGE THIS

this won't work with exceptions such as including an extra tissue, or for instance having the lesion instead of "electrodes".

I made this choice of using a hard-coded list after getting the confirmation from the SimNIBS developers that the list of tissues was always the same in the CHARM output.

How would you obtain a list of tissues different from this one?
Note that this code is dedicated specifically to the import of SimNIBS4/CHARM outputs.
Different pipelines should probably be handled in a different use case.

If this exchange on the SimNIBS GitHub issue is not covering all the possible use cases of SimNIBS4/CHARM, please let us know, either here or on GitHub.

A solution would be to always read the file final_tissues_LUT.txt instead of relying on a hardcoded list.
But I am reluctant to do this if we don't have a clear reason (= a use case) for doing it, as it requires the presence of an additional file (and development time).

Hi Francois,

As it is now, it works if the user only needs the "standard" tissues. In case of additional tissues (e.g. lesion), and, for example, absence of electrode or gel, 1) the new tissue should not be labeled >12 or the pipeline will crash and 2) if labeled between 10 and 12, it will be assigned as electrode or gel whatsoever.

Before checking the code in brainstorm, I hoped that it would rely on the final_tissues_LUT.txt. That would make the pipeline more flexible.

In the meantime, as a temporary solution I just changed the code myself by editing the label names in the brainstorm function.

Thank you,
Ramtin

Before checking the code in brainstorm, I hoped that it would rely on the final_tissues_LUT.txt. That would make the pipeline more flexible.

I added this to my todo list: https://neuroimage.usc.edu/brainstorm/Next#Anatomy

Can you please describe how you obtain a different list of tissues than the one used in the code?
Is this coming from some personal scripts, or standardized and publicly shared processing pipelines (such as CHARM)?

For example by doing this: Removing a lesioned area - #15 by romboide2004

OK, got it. Thanks.

1 Like

I was also wondering how exactly brainstorm behaves when setting up a DUNEuro head model. Specifically:

  • "layer" and "surface" are not the same thing, right? I interpret "layer" as the volume of a certain segmented tissue.

  • "Force source space inside layer "gray"": will the dipoles be forced to be either part of solely the gray matter tissue or within all the volume enclosed in the surface of such layer? The main difference between these two is that the first approach would let me exclude "empty spaces" in the cortex (e.g. lesion masks) from the source space and potentially avoid the known "source space is not convex" error.

Many thanks in advance.

hey @romboide2004 it may be better to open a new discussion for this topic.

it will use the FEM modeling to compute the forward solution.

If you assume a volume mesh/model, then you are right. The layer can be the enclosed volume between two surfaces.

if your model has a brain as one volume, all the dipole will be forced to be within this volume. If you distinguish the WM and GM, then BS will ask you to force diple within the GM.

Sorry about that, I thought that these details might be relevant to correctly handle a lesion, which might potentially create empty spaces in the head model.

This is what is not totally clear to me. By "within" the GM, in a volume model, is it meant all the volume enclosed by the GM surface? If so, if a lesioned tissue is (partially) segmented within the volume enclosed by GM, that will also be included in the source space, right?

If this is the case, perhaps surface models might be more effective to address this issue and make sure dipoles are not in the lesion...

Thank you again,
Ramtin

Probably yes, if you have the final model, we can check it.
But for these specific cases, I recommend that you define a custom source space and then overlay it with the lesioned brain for visual checking.

I am not familiar with implementing a custom source space, which is why so far I relayed on Brainstorm for generating it. I might first try with a surface model (with which I should be able to only stick to the cortex and exclude anything else, I presume...), then explore how to build a custom source space.

Thank you for your help!