4522
Comment:
|
10663
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= Realistic head model: FEM with Duneuro = ''Authors: Takfarinas MEDANI, Juan, Sophie, Christian, Carsten, John, Richard '' |
= Realistic head model: FEM with DUNEuro = '''[TUTORIAL UNDER DEVELOPMENT: NOT READY FOR PUBLIC USE]''' |
Line 4: | Line 4: |
This tutorial explains how to use brainstorm-dueneuro to compute the forward model. | ''Authors: Takfarinas Medani & Juan Garcia-Prieto''''' ''' |
Line 6: | Line 6: |
This forward model uses a finite element element method (FEM) and was developed by the '''...(l''''''ink)'''. It uses the volume mesh of the realistic head model. The goal of this forward solution is mostly for '''EEG users''', to provide more accurate results than the spherical models and more complex geometry than the BEM. It is not necessary for MEG users, as the "overlapping spheres" method gives similar results but much faster. This method is illustrated using the tutorial [[http://neuroimage.usc.edu/brainstorm/Tutorials/Epilepsy|EEG and epilepsy]] or similar data ('''todo'''). | This tutorial explains how to use brainstorm-dueneuro to compute the head model using the finite element method (FEM). |
Line 8: | Line 8: |
refe to these point : http://duneuro.org/ | This forward model uses the FEM method implemented within the [[http://duneuro.org/|Duneuro]]''' '''software. More documentation could be found on this''' '''[[https://gitlab.dune-project.org/duneuro/duneuro/wikis/home|gitlab page]]'''. ''' |
Line 10: | Line 10: |
and to the documentation from here : | The FEM methods use the realistic volume mesh of the head model generated from the segmentation of the magnetic resonance images (MRI). The FEM forward solution provides more accurate results than the spherical models and more realistic geometry and tissue propriety than the BEM. |
Line 12: | Line 12: |
https://gitlab.dune-project.org/duneuro/duneuro/wikis/home | ''In this tutorial, we will describe the software required to use the DUNEuro computation from brainstorm and examples on the FEM computation through the graphical interface. '' |
Line 14: | Line 14: |
Here we will describe the FEM and run some examples | == DUNEuro == '''[[http://duneuro.org/|DUNEuro]] '''is an open-source C++ software library for solving partial differential equations (PDE) in neurosciences using mesh bases methods. It is based on the''' [[https://www.dune-project.org/|DUNE library]] '''and its main features that include solving the electroencephalography (EEG) and magnetoencephalography (MEG) forward problem and providing simulations for brain stimulation. <<BR>> ''' {{attachment:duneuroFromDune.JPG||height="240",width="700"}} ''' '''<<BR>>''' |
Line 16: | Line 17: |
== Duneuro == duneuro is an open-source C++ software library for solving partial differential equations in neurosciences using mesh bases methods. It is based on the DUNE library and its main features include solving the electroencephalography (EEG) and magnetoencephalography (MEG) forward problem and providing simulations for brain stimulation. |
== Citing DUNEuro == Please cite the following papers if you use this software tool or its derivatives in your own work. |
Line 19: | Line 20: |
http://duneuro.org/ | Andreas Nüßing, Maria Carla Piastra, Sophie Schrader, Tuuli Miinalainen, Sampsa Pursiainen, Heinrich Brinck, Carsten H. Wolters, Christian Engwer |
Line 21: | Line 22: |
== Requirements == Duneuro is build on top of DUNE Library, at this time (sept 2019) the code source works only on Linux systems. However we are able to generate the binaries for windows, therefor it can be easily used from Matlab for all platforms. |
''"duneuro - A software toolbox for forward modeling in neuroscience"'' under review |
Line 24: | Line 24: |
However if you want to use the source code of Duneuro you can visite: http://duneuro.org/ | ''"The Brainstrom-Duneuro: friendly interface for the EEG/MEG with the Finite Element Method"'' |
Line 26: | Line 26: |
For the advanced user users, he main steps you need in order to compile for windows are listed here : | underwriting |
Line 28: | Line 28: |
https://github.com/svdecomposer/brainstorm-duneuro | == Software requirements == === FEM Computation : DUNEuro === In order to use the FEM computation, Brainstorm calls the DUNEuro Th DUNEuro binaries are distributed within the [[https://github.com/brainstorm-tools/bst-duneuro|bst-duneuro toolbox]]. These binaries are adapted and tested for Windows, MAC, and Linux 64bit systems. Therefore you don't need to install any extra software package to run the FEM computation, brainstorm will do it for you and install it in Brainstorm user folder (~username/.brainstorm/bst-duneuro/) |
Line 30: | Line 32: |
We distribute the binary files for Windows/Ubunto 64bit systems, you don't need to installan extra Microsoft software package to run '''Duneuro.''' | === FEM mesh : software and toolbox === In order to use the FEM computation of the electromagnetic field (EEG/MEG), the volume mesh of the head is required. Brainstorm integrates most of the modern open-source tools used to generate realistic head mesh, either from nested surface mesh or from individual MR image (T1 or T1 and T2). |
Line 32: | Line 35: |
However, to use this pipline from Brainstorm you need to download these files (link to the binary fles and may be data ... ) | The minimal requirement for FEM mesh generation is the [[http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Download|iso2mesh]] toolbox. For advanced mesh, the list of the available methods are listed and explained in [[https://neuroimage.usc.edu/brainstorm/meshGeneration#preview|this tutorial]]'''. ''' |
Line 34: | Line 37: |
== FEM surfaces / Volume generation == === Volume generation from surface files === In this part you can generate your FEM mesh from surfaces that you can get fron the segmentation software (brainSuite, FreeSurfer ....). |
New methods are under development and will be released to brainstorm in the next future. |
Line 38: | Line 39: |
This process will | The FEM mesh visualization and mesh processing option are integrated with brainstorm. The use of these options requires also the installation of the [[http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Download|iso2mesh]]'''. ''' |
Line 40: | Line 41: |
- merge the surfaces, | Brainstrom will download the last release from this [[https://neuroimage.usc.edu/brainstorm/http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Download|webpage]]''' '''and install it when it is needed. However, you can also download the iso2mesh from the''' '''[[https://github.com/fangq/iso2mesh|github]]''' '''and add it to your Matlab path. |
Line 42: | Line 43: |
- check the self intersecting | === FEM and tissue anisotropy : Brainsuite === Among the advantages of the FEM, the use of tissue anisotropy (conductivity). The estimation of the tissue anisotropy is performed with the Brainsuite diffusion pipeline (BDP link). The diffusion tensor images are estimated with Brainsuite and then converted to conductivity tensor using the Tuch . In order to use this option, you need to install Brainsuite software, the rest of the process is distributed within bst-duneuro.'''<<BR>>'''<<TAG(Advanced)>>''' <<BR>> ''' |
Line 44: | Line 46: |
- fixe the size of the mesh | * DUNEuro software is built on top of the DUNE Library. The Duneuro [[https://gitlab.dune-project.org/duneuro/duneuro|source code]] works only on Linux operating systems. However, we were able to generate the binaries for the main platforms (Windows 64, Linux and Mac), thus, it can be easily used from brainstorm and Matlab without the need to install and compile the tedious Dune and Duneuro libraries on your computer. * The main process of the Duneuro compilation used for brainstorm is explained [[https://github.com/brainstorm-tools/bst-duneuro|here]] |
Line 46: | Line 49: |
- generate the volum mesh | * When you use any options related to the FEM computation, brainstrom will download and install the [[https://github.com/brainstorm-tools/bst-duneuro|bst-duneuro toolbox]]''' '''and all the related toolbox on your computer (iso2mesh, brain2mesh ...). * The''' [[https://simnibs.github.io/simnibs/build/html/documentation/documentation.html|SimNibs]] '''(for FEM mesh generation from MR images) and''' [[http://brainsuite.org/|Brainsuite]] '''(for anisotropy tensor estimation from DWI) should be installed manually on the user's computer. |
Line 48: | Line 52: |
- visual checking ... | == FEM head model == === Volume mesh generation === The basic model is the three realistic layers extracted from the subject's MRI (scalp, inner skull, outer skull), plus the source space (cortical surface). The process of the generation of these surfaces is interactively integrated with brainstorm. In the case you do not have any way to calculate the inner skull and outer skull surfaces, Brainstorm can generate rough approximations based on the subject's cortex and head surfaces and ICBM152's inner and outer skull surfaces. The surfaces created with Brainstorm are by construction non-intersecting. Thus, from these surfaces, you can generate the FEM mesh. |
Line 50: | Line 56: |
- TODO : may be we can add some mesh auqlity measures ?? | Right-click on the subject and then "Generate FEM Mesh", then select the 'iso2mesh' method with the option "MergMesh". Keep the default values for the mesh resolution option (for more documentation please visite iso2mesh [[http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FunctionList|webpage]]). |
Line 52: | Line 58: |
'''<<TAG(Advanced)>>''' | ''' {{attachment:fem_mesh_generation.JPG||height="300",width="230"}} {{attachment:meshMethods.JPG||height="300",width="230"}} {{attachment:iso2meshMergeMethodOptions.JPG||height="200",width="200"}} ''' |
Line 54: | Line 60: |
=== Volume generation from T1 MRI data === You can also generate your own FEM head model and use it from brainstorm to ciompute the forward problem. However the automatic head model generation from from imaging techniques are not accurate and most of the time visual checking are needed and manual correction are required. |
The other mesh generation's methods are explained on this''' [[https://neuroimage.usc.edu/brainstorm/meshGeneration#preview|tutorial]]. ''' |
Line 57: | Line 62: |
==> this depends lagely on the quality of the T1/T2 MRI image. | === Volume mesh visualisation === In this tutorial, we use the ICBM head model template distributed with brainstorm. When the mesh generation is correctly completed, a new node will appear on the anatomy window. '''<<BR>>''' ''' {{attachment:view_default_subject.JPG||height="140",width="200"}} ''' |
Line 59: | Line 65: |
This step is based on the "roast" toolbox (link to roast : https://github.com/andypotatohy/roast | Brainstorm offers also an interactive option to display FEM mesh. The following figure represents the surface mesh on the left (inner, outer and head) and the obtained FEM mesh on the right. |
Line 61: | Line 67: |
) that we adapted for the MEEG forward computation. If you want to generate your own FEM head model from an MRI, you will need to download these file (link), then run the bst process as explained here. | ''' {{attachment:dispIcbmMesh.JPG||height="300",width="580"}} <<BR>> ''' |
Line 63: | Line 69: |
=== Head model based on the level set approach === TODO and Validate |
'''<<BR>>'''<<TAG(Advanced)>>''' <<BR>> ''' |
Line 66: | Line 71: |
== Forward model == === Head model === Number of layers, conductivity value, isotropy/anisotropy/ mesh resolution/ |
If intersections are present on the surfaces, the iso2mesh FEM mesh generation fails and an error will be displayed on the screen. If you face this problem, you need to check the surfaces and/or regenerate new surfaces from the MRI. |
Line 70: | Line 73: |
=== Electrode model === Check the position of the electrodes and align to the head model (projection if needed) |
If you still want to use the intersecting surfaces, you can try with the "MergSurf" option. This option will correct the intersection and create new nodes and elements. We do not recommend to use these models for EEG/MEG forward head computation. This is a research topic and it's still under investigation by the FEM communities. |
Line 73: | Line 75: |
=== Source model === Similarly to the spherical nad BEM head model, the source position are defined on the cortex surface vertices. We can either define a contraned or not constrained orientation. |
== FEM Forward model == To compute the forward model (Gain Matrix) with the FEM method, we assume that you have folowed the introduction tutorials and all the relative data are available(channels files, ...). |
Line 76: | Line 78: |
However, for the FEM model, more paramters could be tuned for the source model. | first,on the anatomy view, you need to select the head model. In the case where you have multiple models, brainstorm uses the model with the name is displayed on green color. You need also to select the cortex to use as the source space. |
Line 78: | Line 80: |
Choice of the source model : PI, Venant, Subtraction, Whitney | '''<<BR>> {{attachment:femNode.JPG||height="200",width="250"}} {{attachment:modelAndCortex.JPG||height="350",width="300"}} <<BR>> ''' |
Line 80: | Line 82: |
Panel of the options choice that the user can select. (other wise we will set to default ) | Then, switch to the view "Functional data (sorted by subjects)", 2nd button above the database explore. Right-click on the subject > Compute head model. Select DUNEuro FEM in the list. |
Line 82: | Line 84: |
'''<<TAG(Advanced)>>''' | ''' {{attachment:ComputeHeadModelDuneuro.JPG||height="350",width="420"}} <<BR>> ''' |
Line 84: | Line 86: |
=== Advanced paramaters === - Solver parameters |
The combined EEG/MEG is possible, and you can mixe between the available methods. |
Line 87: | Line 88: |
- Electrodes projection | A panel (full list of options) related to DUNEuro are displayed and you have the possibilities to change them. At this level we recommend you to use the default values. For advanced users, more details will be aded in this ''page.'' |
Line 89: | Line 90: |
- maybe explain here the relevant option of the mini file ?? | Explanations of the options: * DUNEuro options : If the FEM is not familiar to you, we recommend you to use the default option. The advanced options gives you the possibility to change the FEM source model, parameter of the sources and also a set of option related to the FEM method (''page''). * FEM conductivities: brainstorm detects automatiquely the number of layers and assigne the default isotropic value for each layer. You can change these value according to you model. * You can select how many layers you want to use for the FEM model. The possible options is related to the number of layer on the FEM model. In our case are Scalp (=head), Skull (=outer skull), and Brain (=inner skull). * For EEG: Use all the layers * For MEG: You can use only the inner layers (here brain) * For SEEG : Only the inner (WM) * For ECOG : only the inner layers Then the calculation of the head model will automatically start. You may wait for a very long time. Be patient, it's worth it... |
Line 92: | Line 103: |
refer to : | '''http://duneuro.org/ ''' |
Line 94: | Line 105: |
http://duneuro.org/ | '''https://www.dune-project.org/ ''' |
Line 96: | Line 107: |
https://www.dune-project.org/ | '''https://simnibs.github.io/simnibs/build/html/index.html ''' |
Line 98: | Line 109: |
== Reported Errors & alternative solution == '''<<TAG(Advanced)>>''' |
'''https://simnibs.github.io/simnibs/build/html/documentation/command_line/headreco.html ''' |
Line 101: | Line 111: |
== The MEEG forward problem with the FEM == == License == == Reference == |
'''https://github.com/brainstorm-tools/bst-duneuro/issues/1 ''' '''https://github.com/brainstorm-tools/brainstorm3/issues/242 ''' '''https://github.com/brainstorm-tools/brainstorm3/issues/185 ''' |
Realistic head model: FEM with DUNEuro
[TUTORIAL UNDER DEVELOPMENT: NOT READY FOR PUBLIC USE]
Authors: Takfarinas Medani & Juan Garcia-Prieto
This tutorial explains how to use brainstorm-dueneuro to compute the head model using the finite element method (FEM).
This forward model uses the FEM method implemented within the Duneuro software. More documentation could be found on this gitlab page.
The FEM methods use the realistic volume mesh of the head model generated from the segmentation of the magnetic resonance images (MRI). The FEM forward solution provides more accurate results than the spherical models and more realistic geometry and tissue propriety than the BEM.
In this tutorial, we will describe the software required to use the DUNEuro computation from brainstorm and examples on the FEM computation through the graphical interface.
DUNEuro
DUNEuro is an open-source C++ software library for solving partial differential equations (PDE) in neurosciences using mesh bases methods. It is based on the DUNE library and its main features that include solving the electroencephalography (EEG) and magnetoencephalography (MEG) forward problem and providing simulations for brain stimulation.
Citing DUNEuro
Please cite the following papers if you use this software tool or its derivatives in your own work.
Andreas Nüßing, Maria Carla Piastra, Sophie Schrader, Tuuli Miinalainen, Sampsa Pursiainen, Heinrich Brinck, Carsten H. Wolters, Christian Engwer
"duneuro - A software toolbox for forward modeling in neuroscience" under review
"The Brainstrom-Duneuro: friendly interface for the EEG/MEG with the Finite Element Method"
underwriting
Software requirements
FEM Computation : DUNEuro
In order to use the FEM computation, Brainstorm calls the DUNEuro Th DUNEuro binaries are distributed within the bst-duneuro toolbox. These binaries are adapted and tested for Windows, MAC, and Linux 64bit systems. Therefore you don't need to install any extra software package to run the FEM computation, brainstorm will do it for you and install it in Brainstorm user folder (~username/.brainstorm/bst-duneuro/)
FEM mesh : software and toolbox
In order to use the FEM computation of the electromagnetic field (EEG/MEG), the volume mesh of the head is required. Brainstorm integrates most of the modern open-source tools used to generate realistic head mesh, either from nested surface mesh or from individual MR image (T1 or T1 and T2).
The minimal requirement for FEM mesh generation is the iso2mesh toolbox. For advanced mesh, the list of the available methods are listed and explained in this tutorial.
New methods are under development and will be released to brainstorm in the next future.
The FEM mesh visualization and mesh processing option are integrated with brainstorm. The use of these options requires also the installation of the iso2mesh.
Brainstrom will download the last release from this webpage and install it when it is needed. However, you can also download the iso2mesh from the github and add it to your Matlab path.
FEM and tissue anisotropy : Brainsuite
Among the advantages of the FEM, the use of tissue anisotropy (conductivity). The estimation of the tissue anisotropy is performed with the Brainsuite diffusion pipeline (BDP link). The diffusion tensor images are estimated with Brainsuite and then converted to conductivity tensor using the Tuch . In order to use this option, you need to install Brainsuite software, the rest of the process is distributed within bst-duneuro.
DUNEuro software is built on top of the DUNE Library. The Duneuro source code works only on Linux operating systems. However, we were able to generate the binaries for the main platforms (Windows 64, Linux and Mac), thus, it can be easily used from brainstorm and Matlab without the need to install and compile the tedious Dune and Duneuro libraries on your computer.
The main process of the Duneuro compilation used for brainstorm is explained here
When you use any options related to the FEM computation, brainstrom will download and install the bst-duneuro toolbox and all the related toolbox on your computer (iso2mesh, brain2mesh ...).
The SimNibs (for FEM mesh generation from MR images) and Brainsuite (for anisotropy tensor estimation from DWI) should be installed manually on the user's computer.
FEM head model
Volume mesh generation
The basic model is the three realistic layers extracted from the subject's MRI (scalp, inner skull, outer skull), plus the source space (cortical surface). The process of the generation of these surfaces is interactively integrated with brainstorm. In the case you do not have any way to calculate the inner skull and outer skull surfaces, Brainstorm can generate rough approximations based on the subject's cortex and head surfaces and ICBM152's inner and outer skull surfaces. The surfaces created with Brainstorm are by construction non-intersecting. Thus, from these surfaces, you can generate the FEM mesh.
Right-click on the subject and then "Generate FEM Mesh", then select the 'iso2mesh' method with the option "MergMesh". Keep the default values for the mesh resolution option (for more documentation please visite iso2mesh webpage).
The other mesh generation's methods are explained on this tutorial.
Volume mesh visualisation
In this tutorial, we use the ICBM head model template distributed with brainstorm. When the mesh generation is correctly completed, a new node will appear on the anatomy window.
Brainstorm offers also an interactive option to display FEM mesh. The following figure represents the surface mesh on the left (inner, outer and head) and the obtained FEM mesh on the right.
If intersections are present on the surfaces, the iso2mesh FEM mesh generation fails and an error will be displayed on the screen. If you face this problem, you need to check the surfaces and/or regenerate new surfaces from the MRI.
If you still want to use the intersecting surfaces, you can try with the "MergSurf" option. This option will correct the intersection and create new nodes and elements. We do not recommend to use these models for EEG/MEG forward head computation. This is a research topic and it's still under investigation by the FEM communities.
FEM Forward model
To compute the forward model (Gain Matrix) with the FEM method, we assume that you have folowed the introduction tutorials and all the relative data are available(channels files, ...).
first,on the anatomy view, you need to select the head model. In the case where you have multiple models, brainstorm uses the model with the name is displayed on green color. You need also to select the cortex to use as the source space.
Then, switch to the view "Functional data (sorted by subjects)", 2nd button above the database explore. Right-click on the subject > Compute head model. Select DUNEuro FEM in the list.
The combined EEG/MEG is possible, and you can mixe between the available methods.
A panel (full list of options) related to DUNEuro are displayed and you have the possibilities to change them. At this level we recommend you to use the default values. For advanced users, more details will be aded in this page.
Explanations of the options:
DUNEuro options : If the FEM is not familiar to you, we recommend you to use the default option. The advanced options gives you the possibility to change the FEM source model, parameter of the sources and also a set of option related to the FEM method (page).
- FEM conductivities: brainstorm detects automatiquely the number of layers and assigne the default isotropic value for each layer. You can change these value according to you model.
- You can select how many layers you want to use for the FEM model. The possible options is related to the number of layer on the FEM model. In our case are Scalp (=head), Skull (=outer skull), and Brain (=inner skull).
- For EEG: Use all the layers
- For MEG: You can use only the inner layers (here brain)
- For SEEG : Only the inner (WM)
- For ECOG : only the inner layers
Then the calculation of the head model will automatically start. You may wait for a very long time. Be patient, it's worth it...
Additional documentation
https://simnibs.github.io/simnibs/build/html/index.html
https://simnibs.github.io/simnibs/build/html/documentation/command_line/headreco.html
https://github.com/brainstorm-tools/bst-duneuro/issues/1