15083
Comment:
|
12646
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= Realistic head model: FEM mesh generation = | |
Line 3: | Line 4: |
This page will explain the different options available within brainstorm to generate the FEM mesh. | ''Authors: Takfarinas Medani '' |
Line 5: | Line 6: |
In order to use the finite element method to compute either the EEG/MEG forward problem or the simulate TMS od TDSC stimulation, the mesh of the head model is required. | <<TableOfContents(2,2)>> |
Line 7: | Line 8: |
In this tutorial, we present the different methods available with brainstorm to generate the FEM mesh and how to use them. | == Introduction == This tutorial presents the methods integrated to brainstorm used to generate the FEM mesh. |
Line 9: | Line 11: |
== Available methods == Brainstorm integrated a list of the open-source tools that are commonly used by the FEM community to generate either tetra or hexahedra mesh head model either from surface mesh or from MRI. Here is the list of the available methods in brainstorm: |
The FEM mesh is required for the finite element method computation. The FEM computation could be used for most of the known modalities: EEG/MEG forward problem, TMS or TDSC stimulation and for intracranial modalities like sEEG and ECOG. |
Line 12: | Line 13: |
- [[http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FunctionList|iso2mesh]] | In this tutorial, we present the different methods available with brainstorm to generate the FEM mesh and how to use them from the brainstorm GUI. |
Line 14: | Line 15: |
- [[http://mcx.space/brain2mesh/|Brain2mesh]] | == Mesh tools == Brainstorm integrates a list of open-source tools. These tools are commonly used by the FEM community to generate either tetrahedral or hexahedra mesh. |
Line 16: | Line 18: |
- [[https://simnibs.github.io/simnibs/build/html/index.html|SimNibs]] | Here is the list of the available methods in brainstorm: |
Line 18: | Line 20: |
- [[http://www.fieldtriptoolbox.org/|Fieldtrip]] | - [[http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FunctionList|iso2mesh]]: this option merges the brainstorm surfaces available on the subject and then generate the tetrahedral mesh. - [[http://mcx.space/brain2mesh/|Brain2mesh]]: this option uses the MRI available on the subject, then it calls [[https://www.fil.ion.ucl.ac.uk/spm/software/spm12/|SPM]]segmentation of the volume into 5 tissues (white, gray, SCF, skull and skin). After that, it calls iso2mesh (internally) to generate the tetrahedral mesh. - [[https://simnibs.github.io/simnibs/build/html/index.html|SimNibs]] : this option, recommended for a realistic model, calls the [[https://simnibs.github.io/simnibs/build/html/documentation/command_line/headreco.html|headreco]]process, it uses the MRIs of the subject, and then calls SPM and [[http://www.neuro.uni-jena.de/cat/|CAT]] for the segmentation. Then the mesh generation is performed internally by integrated tools (netgen, gmesh and meshfixe). - [[http://www.fieldtriptoolbox.org/|Fieldtrip]] : this option call the Fieldtrip pipeline, based on the segmentation of the MRI then the hexahedral mesh generation. |
Line 24: | Line 32: |
=== iso2mesh === iso2mesh is a matlab /octave-based mesh generation and processing toolbox. It can [[http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/Workflow|create 3D tetrahedral finite element (FE) mesh from surfaces, 3D binary and gray-scale volumetric images]] such as segmented MRI/CT scans. |
== iso2mesh == iso2mesh is a Matlab /octave-based mesh generation and processing toolbox. It can [[http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/Workflow|create 3D tetrahedral finite element (FE) mesh from surfaces, 3D binary and gray-scale volumetric images]] such as segmented MRI/CT scans. |
Line 27: | Line 35: |
'''Requirement ''' | === Requirement === it If iso2mesh is not installed in your computer, 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 29: | Line 38: |
it If iso2mesh is not installed in your computer, 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. '''When and how to use it''' |
=== When and how to use it === |
Line 35: | Line 41: |
Assuming the situation where you have surfaces mesh of your subject available and you have already computed the [[https://neuroimage.usc.edu/brainstorm/Tutorials/TutBem?highlight=(bem)|OpenMeeg]]forward problem. If you want to use the duneuro FEM to compute the forward model, you need to generate the FEM mesh from the similar surface used by OpenMeeg. | Assuming the situation where you have surfaces mesh of your subject available and you have already computed the [[https://neuroimage.usc.edu/brainstorm/Tutorials/TutBem?highlight=(bem)|OpenMeeg]]forward problem. If you want to use the duneuro FEM to compute the forward model, you need to generate the FEM mesh from a similar surface used by OpenMeeg Here is the way to do it : |
Line 37: | Line 43: |
Here is the way to do it : | 1. Richt-click on the subject: In this way, brainstorm will load the inner, outer and the head from the subject data. if any of these surfaces is missing, an error will be displayed. 1. Select the 'Generate FEM mesh' item, 1. Select the iso2mesh option, 1. Set the iso2mesh parameters, |
Line 39: | Line 48: |
1- Richt click on the subject | 1. These options are used by the surf2mesh function. Select either '''MergeMesh''' or '''MergeSurf.''' 1. '''Max tetrahedral volum''' : is the maximum volume of the tetrahedral element in the mesh. '''Pourcentage of the element to keep''': parameter between 0-100%, it used to keep or not the original input surface nodes. |
Line 41: | Line 52: |
. With this way, brainstorm will load the inner, outer and the head from the subject data. if any of these surfaces is missing, an error will be displayed. | Also, a full example is explained in this [[https://neuroimage.usc.edu/brainstorm/Duneuro?highlight=(duneuro)|page]]. |
Line 43: | Line 54: |
2- Select the 'Generate FEM mesh' | . |
Line 45: | Line 56: |
3- Slect the iso2mesh option | {{attachment:iso2meshProcess.JPG||height="380",width="720"}} |
Line 47: | Line 58: |
4- Set the iso2mesh parameters | Here is a view of mesh obtained with different values of the Max volume = [10, 1, 0.1, 0.01] with a keep ratio = 100%. |
Line 49: | Line 60: |
. These options are used by the surf2mesh function. Select either MergeMesh or MergeSurf MaxVol : is the maximum value of the tetrahedral element in the mesh. keepratio : parameter between 0-1, it used to keep or not the original input surface nodes |
{{attachment:IcbmMeshModels.jpg||height="420",width="700"}} [[https://neuroimage.usc.edu/brainstorm/reviewMEEGForward?highlight=(duneuro)|From our tests]], a FEM head model with a value of 0,1 for the tetrahedral volume achieves similar results as the OpenMeeg head model computed from the same surfaces. We have also noticed that the result with v = 0,001 is almost similar to v = 0,01. Increasing the mesh resolution needs more time to generate the mesh, more time to perform the FEM computation and of course more memory to store the mesh in the database. '''<<TAG(Advanced)>>''' If intersections are present on the surfaces mesh, the iso2mesh FEM mesh generation fails (tetgen) 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. === other application === You can also select any surface mesh, or multiple surfaces (with Shift key), on the brainstorm anatomy windows and then generate tetrahedral mesh by following the same steps explained above. Here are some examples using only 2 tissues. This option could be useful for investigation of tissues influence on the EEG/MEG on the forward solution or on the source localization, furthermore, this option could be used for analyzing only SEEG within brain volume. {{attachment:otherMesh.JPG||height="320",width="600"}} == brain2mesh == Brain2Mesh is a MATLAB/Octave based 3D mesh generation toolbox dedicated to the creation of high-quality multi-layered brain mesh models. === Requirement === Brain2Mesh is developed by the same team that developed the iso2mesh toolbox. Therefore iso2mesh is required. So if these toolboxes are not available on your computer, Brainstorm will download the last release and install it when it's needed. You may also need the [[https://www.fil.ion.ucl.ac.uk/spm/software/spm12/|SPM12 toolbox]]. Brain2mesh is used only to generate tetrahedral mesh from the segmentation output. Therefore a segmentation of the MRI will be performed by SPM when this option is called. More parameters will be added in the next version. If you are using this method you can request our support to help you or to add these parameters asap. === When and how to use it === This option is used when you have the individual MRI of the subject either T1 or T1 and T2. As said before, the SPM toolbox is required. The time required for this option is around 1 hour. here is the view of the obtained mesh from a T1 MRI {{attachment:brain2meshModel.JPG||height="450",width="600"}} This option is based on the [[http://mcx.space/brain2mesh/|brain2mesh toolbox]], we keep the default options. We will add more flexibility to control these options in the next future. However, if you want to use this option and you need support, we can help... just post your question on the forum or email us. == Fieldtrip == This option call [[www.fieldtriptoolbox.org/tutorial/headmodel_eeg_fem/|the process of fieldtrip MRI segmentation]] (function ft_volumesegment) and hexahedral mesh generation (ft_meshprepare) develloped by the [[https://www.mrt.uni-jena.de/simbio/index.php?title=Main_Page|SimBio]] team. === Requirement === To use this option, the [[http://www.fieldtriptoolbox.org/getting_started/|Fieldtrip]] and [[https://www.fil.ion.ucl.ac.uk/spm/software/spm12/|SPM toolbox]] should be in your matlab. === When and how to use it === This option can be called by two processes, either from the MRI or from any segmented tissue available on the brainstorm database. The mesh generation with the method is faster. It converts all the voxels to hexahedral mesh. Only the hexahedral mesh is available for this method. You can either call this option from the MRI data or from any segmentation data available on the subject. If you call it from the MRI, a segmentation is processed first, then the mesh. If you call from the tissues, only the mesh process will be performed. {{attachment:mriAndTissue.JPG||height="450",width="700"}} Right-click on the MRI (or the tissues), then "Generate FEM Mesh" then select Fieldtrip option. There are two parameters that the user needs to set, the downsampling of the volume and the node shift ratio. {{attachment:fieldTripMeshCall.jpg||height="380",width="650"}} The option "Downsamp volume before meshing" will reduce the number of voxel by this factor. The "Shift node" option calls the adaptative mesh generation. The process moves the nodes located on the interface either inward or outward in order to fit the geometry as explained [[http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_fem/|here]]. This figure shows an example (from Fieldtrip webpage), left the unshifted and on the right the shifted. {{attachment:nodeShiftFigure.JPG||height="200",width="500"}} This method is fast compare to the previous options, the following figures show examples of the mesh obtained with fieldtrip option from the ICBM model. {{attachment:fieldTripMeshICBM.JPG||height="300",width="700"}} == SimNIBS == [[https://simnibs.github.io/simnibs/build/html/index.html|SimNIBS]]software develloped to calculate electric fields caused by Transcranial Electrical Stimulation (TES) and Transcranial Magnetic Stimulation (TMS). From its pipline, brainstorm integrates the process of the automatic segmentation of MRI images and meshing to create individualized head models. This process is called "headreco and it's explained [[https://simnibs.github.io/simnibs/build/html/documentation/command_line/headreco.html|here]]. === Requirement === SimNibs is an independent software, brainstorm call its functions internally therefore you need to install SimNibs and its dependencies. For more details please follow the instructions as explained in [[https://simnibs.github.io/simnibs/build/html/installation/simnibs_installer.html|this webpage]]. To resume, this process calls SPM12 and CAT for the tissue segmentation, then it calls Gmesh and Netgen for the tetrahedral mesh generation. The mesh is checked and repaired by calling the meshfixe process. Depending on your computer performances, this process will take between 2 to 5 hours. We highly recommend closing all other running processes and applications on your computer in order to speed this process. === When and how to use it === Brainstorm can call the main function used for the mesh generation frm the main graphical interface. To create individualized models, SimNIBS '''require as''' a T1-weighted image. T2-weighted images are optional, but '''highly recommended'''. The main steps used by SimNIBS are explained in this [[https://simnibs.github.io/simnibs/build/html/tutorial/head_meshing.html|page]]. When you have your MRI data available on your subject, follow the same steps are explained above, then select the "SimNibs" method. There is one option related to SimNibs, which is the 'Vertex density' or the number of node per mm2 {{attachment:SimNibsOption.JPG||height="150",width="250"}} If you have T1 and T2, you need to call this process by a right-click on the subject in order to include the two datasets, or you can select the T1 and T2 then call the Generate FEM mesh process. * If there is an MRI file with the string "T2" in the subject anatomy folder, it will use it * Otherwise, if you select explicitly two MRI files with CTRL+Click, it will use the first one as the T1 and the second one as the T2 (this needs to be documented in the tutorial) The output head models obtained with this method are represented in the following figure. {{attachment:SimNibsICBMModel.JPG||height="300",width="700"}} The model has 5 layers representing the white matter, gray matter, CSF, skull and scalp. == Roast == comming soon under development and integration. For more information, please visit: https://www.parralab.org/roast/ and https://github.com/andypotatohy/roast == Brainsuite == === Brainsuite Installation === === Tissue anisotropy estimation === '''<<TAG(Advanced)>>''' == Brainstorm template == https://github.com/brainstorm-tools/brainstorm3/issues/185#issuecomment-576749612 == Level set == comming soon |
Line 55: | Line 168: |
{{attachment:iso2meshProcess.JPG||height="400",width="700"}} A full example is explained in this [[https://neuroimage.usc.edu/brainstorm/Duneuro?highlight=(duneuro)|page]]. '''SimNIBS Installation''' Please follow the instructions on this [[https://simnibs.github.io/simnibs/build/html/installation/simnibs_installer.html|webapge]]''__ (new brainstom page that explain how to generate the head model is under development)__'' in order to do the SimNibs software shoud be installed in your computer. ==== Iso2Mesh Installation ==== If iso2mesh is not installed in your computer, 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. ==== Brain2Mesh Installation [TODO] ==== ==== Brainsuite Installation [TODO] ==== == FEM surfaces / Volume generation == === Volume mesh generation from Brainstorm === The most modern software that are used to generate the volume mesh head model are integrated within brainstorm with an easy graphical interface to use call these tools. Right click on the subject and then "Generate FEM Mesh" {{attachment:menuGenerateFemMesh.PNG|height="40",width="150"}} The available options are : . {{attachment:FemMeshMethods.PNG|height="50",width="100"}} "Iso2mesh" : This option merges the brainstorm surfaces available on the subject and then generarte the tetrahedral mesh. "Brain2Mesh" : This options uses the MRIs available on the subjects, then it calls the SPM segmentation of the volume into 5 tissus (white, gray, scf, skull and skin). After that it converts into a tetrahedral mesh. "SimNibs" : The recommended option, it calls the headreco {ref} and generate a FEM head model "FieldTrip" : (in progress) "Roast" : (in progress) "headreco" : https://simnibs.github.io/simnibs/build/html/documentation/command_line/headreco.html This function is part of the SimNibs software: https://simnibs.github.io/simnibs/build/html/index.html === headreco === The headreco function is fully integrated to brainstorm. With this option, brainstorm can reconstructs a tetrahedral head mesh from T1- and T2-weighted structural MR images. It runs also with only a T1w image, but it will achieve more reliable skull segmentations when a T2w image is supplied. === Surface mesh generation from volume mesh === === 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 ....). This process will - merge the surfaces, - check the self intersecting - fixe the size of the mesh - generate the volum mesh - visual checking ... - TODO : may be we can add some mesh auqlity measures ?? '''<<TAG(Advanced)>>''' === Volume generation from T1/T2 MRI data === You can also generate your own FEM head model and then load it to brainstorm. 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. ==> this depends lagely on the quality of the T1/T2 MRI image(https://simnibs.github.io/simnibs/build/html/tutorial/head_meshing.html). This step is based on the "roast" toolbox (link to roast : https://github.com/andypotatohy/roast ) 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. * If there is a MRI file with the string "T2" in the subject anatomy folder, it will use it * Otherwise, if you select explicitly two MRI files with CTRL+Click, it will use the first one as the T1 and the second one as the T2 (this needs to be documented in the tutorial) === FEM Head model generation with SimNibs === This method used the SimNibs software. So to call this process, you need to download and install the SimNibs software, the process of the installation is explained in the SimNibs webpage : https://simnibs.github.io/simnibs/build/html/installation/simnibs_installer.html. When you have installed SimNibs, Brainstorm can call the main function used for the mesh generation frm the main graphical interface. Depemding on your computer performances, this process will take between 2 to 5 hours. We highly recommend to close all other running process and application on our computer in order to speed this process. - Explain here the main steps with screenshots : 1- Create new subject within the current protocole 2- Load the T1 of the subject to the brainstorm database. 3- Associate a T2 mri to the subject if it's available (this is better for csf/skull/scalp segmentation) 4- Right click on the subject, select the "Generate FEM mesh" . Select "SIMNIBS", and choose "Tetrahedral element" and keep the other options to the default value. 5- When this process is finished, a new node will appear in the data base, which hase he name "FEM xxxV, (simNibs, yLayers)". This is the FEM mesh model generated from the T1. === FEM Head model template === - Load the FEM volumic mesh (template created from ICBM T1 MRI using SimNibs) - Load the surface mesh (template created also from ICBM using ICBM ) and then generates the volume mesh (either tetra or hexa) by calling the tetgen process cia iso2mesh toolbox (if hexa are desired, the tetra mesh will be converted to hexa ... ) https://github.com/brainstorm-tools/brainstorm3/issues/185#issuecomment-576749612 === Head model based on the level set approach === TODO and Validate == Errors == <<BR>>'''<<TAG(Advanced)>>''' <<BR>> The most modern software that are used to generate the volume mesh head model are integrated within brainstorm with an easy graphical interface to use call these tools. Right click on the subject and then "Generate FEM Mesh" The available options are : . "Iso2mesh" : This option merges the brainstorm surfaces available on the subject and then generarte the tetrahedral mesh. "Brain2Mesh" : This options uses the MRIs available on the subjects, then it calls the SPM segmentation of the volume into 5 tissus (white, gray, scf, skull and skin). After that it converts into a tetrahedral mesh. "SimNibs" : The recommended option, it calls the headreco {ref} and generate a FEM head model "FieldTrip" : (in progress) "Roast" : (in progress) "headreco" : https://simnibs.github.io/simnibs/build/html/documentation/command_line/headreco.html This function is part of the SimNibs software: https://simnibs.github.io/simnibs/build/html/index.html === headreco === The headreco function is fully integrated to brainstorm. With this option, brainstorm can reconstructs a tetrahedral head mesh from T1- and T2-weighted structural MR images. It runs also with only a T1w image, but it will achieve more reliable skull segmentations when a T2w image is supplied. === Surface mesh generation from volume mesh === === 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 ....). This process will - merge the surfaces, - check the self intersecting - fixe the size of the mesh - generate the volum mesh - visual checking ... - TODO : may be we can add some mesh auqlity measures ?? '''<<TAG(Advanced)>>''' === Volume generation from T1/T2 MRI data === You can also generate your own FEM head model and then load it to brainstorm. 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. ==> this depends lagely on the quality of the T1/T2 MRI image(https://simnibs.github.io/simnibs/build/html/tutorial/head_meshing.html). This step is based on the "roast" toolbox (link to roast : https://github.com/andypotatohy/roast ) 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. * f there is a MRI file with the string "T2" in the subject anatomy folder, it will use it * Otherwise, if you select explicitly two MRI files with CTRL+Click, it will use the first one as the T1 and the second one as the T2 (this needs to be documented in the tutorial) === FEM Head model generation with SimNibs === This method used the SimNibs software. So to call this process, you need to download and install the SimNibs software, the process of the installation is explained in the SimNibs webpage : https://simnibs.github.io/simnibs/build/html/installation/simnibs_installer.html. When you have installed SimNibs, Brainstorm can call the main function used for the mesh generation frm the main graphical interface. Depemding on your computer performances, this process will take between 2 to 5 hours. We highly recommend to close all other running process and application on our computer in order to speed this process. - Explain here the main steps with screenshots : 1- Create new subject within the current protocole 2- Load the T1 of the subject to the brainstorm database. 3- Associate a T2 mri to the subject if it's available (this is better for csf/skull/scalp segmentation) 4- Right click on the subject, select the "Generate FEM mesh" . Select "SIMNIBS", and choose "Tetrahedral element" and keep the other options to the default value. 5- When this process is finished, a new node will appear in the data base, which hase he name "FEM xxxV, (simNibs, yLayers)". This is the FEM mesh model generated from the T1. === FEM Head model template === - Load the FEM volumic mesh (template created from ICBM T1 MRI using SimNibs) - Load the surface mesh (template created also from ICBM using ICBM ) and then generates the volume mesh (either tetra or hexa) by calling the tetgen process cia iso2mesh toolbox (if hexa are desired, the tetra mesh will be converted to hexa ... ) https://github.com/brainstorm-tools/brainstorm3/issues/185#issuecomment-576749612 === Head model based on the level set approach === TODO and Validate if users want to use freesurfer and simnibs, the priority is given to freesurfer, then load the fs files, then call simnibs headmodel generation from t1/t2. == FEM computation and interface to DUNEuro == === Head model === Number of layers, conductivity value, isotropy/anisotropy/ mesh resolution/ === Electrode model === Check the position of the electrodes and align to the head model (projection if needed) === 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. However, for the FEM model, more paramters could be tuned for the source model. Choice of the source model : PI, Venant, Subtraction, Whitney Panel of the options choice that the user can select. (other wise we will set to default ) '''<<TAG(Advanced)>>''' === Advanced paramaters === - Solver parameters - Electrodes projection - maybe explain here the relevant option of the mini file ?? == Additional documentation == refer to : http://duneuro.org/ https://www.dune-project.org/ https://simnibs.github.io/simnibs/build/html/index.html == Reported Errors & alternative solution == '''<<TAG(Advanced)>>''' simnibs pblm : https://simnibs.github.io/simnibs/build/html/installation/throubleshooting.html == The MEEG forward problem with the FEM == == License == |
|
Line 299: | Line 169: |
== Additional documentation == https://github.com/brainstorm-tools/bst-duneuro/issues/1 https://github.com/brainstorm-tools/brainstorm3/issues/242 |
Realistic head model: FEM mesh generation
[TUTORIAL UNDER DEVELOPMENT: NOT READY FOR PUBLIC USE]
Authors: Takfarinas Medani
Contents
Introduction
This tutorial presents the methods integrated to brainstorm used to generate the FEM mesh.
The FEM mesh is required for the finite element method computation. The FEM computation could be used for most of the known modalities: EEG/MEG forward problem, TMS or TDSC stimulation and for intracranial modalities like sEEG and ECOG.
In this tutorial, we present the different methods available with brainstorm to generate the FEM mesh and how to use them from the brainstorm GUI.
Mesh tools
Brainstorm integrates a list of open-source tools. These tools are commonly used by the FEM community to generate either tetrahedral or hexahedra mesh.
Here is the list of the available methods in brainstorm:
- iso2mesh: this option merges the brainstorm surfaces available on the subject and then generate the tetrahedral mesh.
- Brain2mesh: this option uses the MRI available on the subject, then it calls SPMsegmentation of the volume into 5 tissues (white, gray, SCF, skull and skin). After that, it calls iso2mesh (internally) to generate the tetrahedral mesh.
- SimNibs : this option, recommended for a realistic model, calls the headrecoprocess, it uses the MRIs of the subject, and then calls SPM and CAT for the segmentation. Then the mesh generation is performed internally by integrated tools (netgen, gmesh and meshfixe).
- Fieldtrip : this option call the Fieldtrip pipeline, based on the segmentation of the MRI then the hexahedral mesh generation.
You can display the full list and a short description by right click on the MRI of the subject and then click the item "Generate FEM Mesh"
iso2mesh
iso2mesh is a Matlab /octave-based mesh generation and processing toolbox. It can create 3D tetrahedral finite element (FE) mesh from surfaces, 3D binary and gray-scale volumetric images such as segmented MRI/CT scans.
Requirement
it If iso2mesh is not installed in your computer, 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.
When and how to use it
iso2mesh is used as the basic option by brainstorm to generate FEM mesh from surfaces mesh.
Assuming the situation where you have surfaces mesh of your subject available and you have already computed the OpenMeegforward problem. If you want to use the duneuro FEM to compute the forward model, you need to generate the FEM mesh from a similar surface used by OpenMeeg Here is the way to do it :
- Richt-click on the subject: In this way, brainstorm will load the inner, outer and the head from the subject data. if any of these surfaces is missing, an error will be displayed.
- Select the 'Generate FEM mesh' item,
- Select the iso2mesh option,
- Set the iso2mesh parameters,
- These options are used by the surf2mesh function.
Select either MergeMesh or MergeSurf.
Max tetrahedral volum : is the maximum volume of the tetrahedral element in the mesh. Pourcentage of the element to keep: parameter between 0-100%, it used to keep or not the original input surface nodes.
Also, a full example is explained in this page.
Here is a view of mesh obtained with different values of the Max volume = [10, 1, 0.1, 0.01] with a keep ratio = 100%.
From our tests, a FEM head model with a value of 0,1 for the tetrahedral volume achieves similar results as the OpenMeeg head model computed from the same surfaces. We have also noticed that the result with v = 0,001 is almost similar to v = 0,01.
Increasing the mesh resolution needs more time to generate the mesh, more time to perform the FEM computation and of course more memory to store the mesh in the database.
If intersections are present on the surfaces mesh, the iso2mesh FEM mesh generation fails (tetgen) 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.
other application
You can also select any surface mesh, or multiple surfaces (with Shift key), on the brainstorm anatomy windows and then generate tetrahedral mesh by following the same steps explained above.
Here are some examples using only 2 tissues. This option could be useful for investigation of tissues influence on the EEG/MEG on the forward solution or on the source localization, furthermore, this option could be used for analyzing only SEEG within brain volume.
brain2mesh
Brain2Mesh is a MATLAB/Octave based 3D mesh generation toolbox dedicated to the creation of high-quality multi-layered brain mesh models.
Requirement
Brain2Mesh is developed by the same team that developed the iso2mesh toolbox. Therefore iso2mesh is required. So if these toolboxes are not available on your computer, Brainstorm will download the last release and install it when it's needed.
You may also need the SPM12 toolbox. Brain2mesh is used only to generate tetrahedral mesh from the segmentation output. Therefore a segmentation of the MRI will be performed by SPM when this option is called.
More parameters will be added in the next version. If you are using this method you can request our support to help you or to add these parameters asap.
When and how to use it
This option is used when you have the individual MRI of the subject either T1 or T1 and T2. As said before, the SPM toolbox is required. The time required for this option is around 1 hour. here is the view of the obtained mesh from a T1 MRI
This option is based on the brain2mesh toolbox, we keep the default options. We will add more flexibility to control these options in the next future. However, if you want to use this option and you need support, we can help... just post your question on the forum or email us.
Fieldtrip
This option call ?the process of fieldtrip MRI segmentation (function ft_volumesegment) and hexahedral mesh generation (ft_meshprepare) develloped by the SimBio team.
Requirement
To use this option, the Fieldtrip and SPM toolbox should be in your matlab.
When and how to use it
This option can be called by two processes, either from the MRI or from any segmented tissue available on the brainstorm database.
The mesh generation with the method is faster. It converts all the voxels to hexahedral mesh.
Only the hexahedral mesh is available for this method. You can either call this option from the MRI data or from any segmentation data available on the subject. If you call it from the MRI, a segmentation is processed first, then the mesh. If you call from the tissues, only the mesh process will be performed.
Right-click on the MRI (or the tissues), then "Generate FEM Mesh" then select Fieldtrip option. There are two parameters that the user needs to set, the downsampling of the volume and the node shift ratio.
The option "Downsamp volume before meshing" will reduce the number of voxel by this factor.
The "Shift node" option calls the adaptative mesh generation. The process moves the nodes located on the interface either inward or outward in order to fit the geometry as explained here. This figure shows an example (from Fieldtrip webpage), left the unshifted and on the right the shifted.
This method is fast compare to the previous options, the following figures show examples of the mesh obtained with fieldtrip option from the ICBM model.
SimNIBS
SimNIBSsoftware develloped to calculate electric fields caused by Transcranial Electrical Stimulation (TES) and Transcranial Magnetic Stimulation (TMS). From its pipline, brainstorm integrates the process of the automatic segmentation of MRI images and meshing to create individualized head models. This process is called "headreco and it's explained here.
Requirement
SimNibs is an independent software, brainstorm call its functions internally therefore you need to install SimNibs and its dependencies. For more details please follow the instructions as explained in this webpage.
To resume, this process calls SPM12 and CAT for the tissue segmentation, then it calls Gmesh and Netgen for the tetrahedral mesh generation. The mesh is checked and repaired by calling the meshfixe process. Depending on your computer performances, this process will take between 2 to 5 hours. We highly recommend closing all other running processes and applications on your computer in order to speed this process.
When and how to use it
Brainstorm can call the main function used for the mesh generation frm the main graphical interface. To create individualized models, SimNIBS require as a T1-weighted image. T2-weighted images are optional, but highly recommended. The main steps used by SimNIBS are explained in this page.
When you have your MRI data available on your subject, follow the same steps are explained above, then select the "SimNibs" method. There is one option related to SimNibs, which is the 'Vertex density' or the number of node per mm2
If you have T1 and T2, you need to call this process by a right-click on the subject in order to include the two datasets, or you can select the T1 and T2 then call the Generate FEM mesh process.
* If there is an MRI file with the string "T2" in the subject anatomy folder, it will use it
- Otherwise, if you select explicitly two MRI files with CTRL+Click, it will use the first one as the T1 and the second one as the T2 (this needs to be documented in the tutorial)
The output head models obtained with this method are represented in the following figure.
The model has 5 layers representing the white matter, gray matter, CSF, skull and scalp.
Roast
comming soon under development and integration.
For more information, please visit: https://www.parralab.org/roast/ and https://github.com/andypotatohy/roast
Brainsuite
Brainsuite Installation
Tissue anisotropy estimation
Brainstorm template
https://github.com/brainstorm-tools/brainstorm3/issues/185#issuecomment-576749612
Level set
comming soon