dimst23/tTIS-FEM-and-Optimization: tTIS FEM and Optimization Code
Creators
Description
Description
In the code folder, the main software can be found. The folder contains the Core part which implements the meshing and solution for all models. The Scripts folder contains all the necessary scripts to produce a solved model and most of these scripts call functions from the Core folder.
The scripts, included in the unanimous folder, are named based on the stage at which they are used and this naming follows the pattern of [Stage-Name]_Short_Description
.
Short explanation of the pipeline
For a detailed explanation of the software and the pipeline check here.
- At first the electrode positions for the desired models have to be calculated using Mesh2EEG, producing a file which contains the electrode names and their corresponding position for the particular model.
- Before doing any mesh manipulation work (including meshing the model), it is suggested to run all meshes through MeshFix, thus avoiding any errors during the next steps. An automation script for MeshFix can be found in the Utilities folder, named
mesh_fixing.py
. - The next step is to add the electrodes on the skin surface for each model. This is done using the
[Meshing]_Model_POLY.py
script, generating a.poly
file to be used later by TetGen. - After the successful generation of the
.poly
file(s) for the desired model(s), TetGen has to be called for each model. A utility script can be found in the Utilities folder, namedtetgen_meshing.sh
. - Having the tetrahedralized meshes, the next step is to solve the models. A script solving all models for all electrode combinations using one electrode as a reference, is provided in the script named
[Solution]_Electrode_Combinations.py
. The solver part of the code can be adapted to solve only one model, selecting the desired electrode pairs and injection currents. - With all models solved the optimizer can run. The script named
[Optimization]_Gentic_Algorithm.py
contains the genetic algorithm and the corresponding settings required for running the optimizer. - The results of the optimization include the objective function value and the optimized electrode pairs. To save the currents that optimized the electrode pairs, the scripts named
[Post-process]_Result_Validation.py
and located inData Analysis
has to be called. *Lastly, all scripts found in theNifti Operations
folder are used in the Nifti generation and manipulations, after all the above have been successfully completed.
In some scripts included in the pipeline described above, the sim_settings.yml
file is used. This file serves as a settings container for the electrode names and indices, as well as the mesh location and the output directory of the solver.
Files
dimst23/tTIS-FEM-and-Optimization-v1.0.0.zip
Files
(54.4 kB)
Name | Size | Download all |
---|---|---|
md5:90a807c41a7b008eb3b835009adbbb4c
|
54.4 kB | Preview Download |
Additional details
Related works
- Is supplement to
- https://github.com/dimst23/tTIS-FEM-and-Optimization/tree/v1.0.0 (URL)