Exporting generated head models from and to matlab

Hello,

Is it possible to used the electrode position file from brainstorm to compute the FEM source model using field trip in Matlab. I tried 'exporting' the electrode position to Matlab. I do see it as a variable but whenever I try to use it, I get an error. and If that is possible can I import the head source model to brainstorm so I can use it in 'computing source model' ?

Thank you

Note that Brainstorm now features DUNEuro, the successor of the SimBio toolbox (used in FieldTrip). Not fully documented yet, but soon.
https://neuroimage.usc.edu/brainstorm/Tutorials/Duneuro

The process Sources > FieldTrip: ft_prepare_leadfield would give you an example of how to convert Brainstorm structure into FieldTrip structures. Same for all the other process_ft_*.m functions.

THank you Francois, I treid your suggestion(ft_prepare_leadfield), with the following options:

  • Surfaces used for the head model :slight_smile:
  • field trip: ft_volumesegment +........
    Forward modeling method:
    I tried all of the BEM options

I get the following error message

then I tried
surfaces : Brainstorm: surfaces from the database
->it finished successfully but as I was using ft_sourceanalysis I got another error message

Waleed

I never wrote the code to support FieldTrip FEM in Brainstorm, and calling the BEM has no interest since we have a direct support of OpenMEEG directly in Brainstorm.

What I had in mind was not to suggest that you use a Brainstorm process, but that you read the code of the process_ft_*.m functions for having examples of how to use the conversion to convert Brainstorm structures into FieldTrip structures (out_fieldtrip_*.m) and vice versa (in_..._fieldtrip.m).
Then read the FieldTrip-SimBio tutorials to learn how to compute a FEM solution in FieldTrip.

Is it for validation purposes that you want to use the FieldTrip FEM?

I am just trying to find a way to generate a FEM head model from FEM mesh. I am successful in creating the mesh but DuNeuro is not working on any of the meshes generated regardless of the method I use. I am not sure if I am doing something wrong. I can view the mesh and it looks ok to me.

Can you describe more precisely what "is not working" means?

Have you tried with very simple models? (source space downsampled to 50 vertices, FEM mesh generated with iso2mesh from BEM surfaces with very low resolution)

@tmedani

Hello all,

@wabood1 could try to reproduce the steps for a basic FEM head model as explained in this tutorial: https://neuroimage.usc.edu/brainstorm/Tutorials/Duneuro#FEM%20head%20model

This will give you a general idea of how the process works.
Could you also share a screenshot of the errors that you have with DUNEuro.

You need also to check the position of the cortex and the electrodes with the mesh,
you can also read this part, https://neuroimage.usc.edu/brainstorm/Tutorials/ReviewForward#EEG_within_brainstorm_template_.283_layers.29

Once you have this basic example working, you can use more complex models.

Let us know if you have further issues.

Best,