Mesh files format

Meshes are generated by a dedicated Julia script in two steps:

  1. A first *.msh is obtained by segmentation from T1 and T2 MRI scans using the charm tool from SimNIBS software,
  2. This files is rescaled to meter unit, centered at origin (0,0,0) and converted to *.msh in ASCII format v4.1 thanks to the Gmsh API.
--- config: htmlLabels: false --- flowchart LR Init["`__T1 and T2 files:__ *xxx-T1.nii.gz* *xxx-T2.nii.gz* `"] charm(["`charm`"]) MSH2["` MSH2 *.msh file `"] Julia(["` Gmsh API `"]) MSH4["` **Final .msh file:** *MSH 4.1 / In meters* *Center at origin* **+ .msh.opt file**`"] Init --- charm --> MSH2 --- Julia --> MSH4

Both .msh and .msh.opt resulting files are compressed in an .tar.gz archive as follow:

1g00y000h00w.tar.gz
2    ├── g00y000h00w.msh
3    └── g00y000h00w.msh.opt

We have chosen the following naming convention : gender (1st letter) / age / height / weight. For example:

  • f25y165h60w = 25-year-old woman, height: 165 cm, weight: 60 kg
  • m65y180h90w = 65-year-old man, height: 180 cm, weight: 90 kg

Each file is briefly described below:

By default charm produced a .msh in binary MSH2 format. For better compatibility, we choose to convert it to the more modern format: ASCII MSH version 4.1.

Each organ is identified by a volumic physical region number according to the following table; we have also included the corresponding boundaries (physical surfaces). It should be noted that we have retained the notations defined by SimNIBS.

Organ Physical volume number Boundary
White matter (WM) 1 1001
Gray matter (GM) 2 1002
Cerebrospinal fluid (CSF) 3 1003
Scalp 5 1005
Eye balls 6 1006
Compact bone 7 1007
Spongy bone 8 1008
Blood 9 1009
Muscle 10 1010

In addition to the *.msh file, we provide a *.msh.opt file that is automatically loaded when the *.msh file is opened by Gmsh (if it is located in the same directory). This file names and colors the physical regions and configures the visual rendering of the mesh.

Moreover, it contains some metrics about mesh quality criteria:

  • minSICN for the sampled minimal signed inverted condition number,
  • minSIGE for the sampled signed inverted gradient error,
  • and gamma for the ratio of the inscribed to circumcribed sphere radius.

These values are in the form of comments at the end of the file. An example is given below:

 1// Mesh quality analysis: 
 2//############################
 3// 
 4// minSICN: 
 5//---------- 
 6//    * average minSICN: 0.7642
 7//    * # elements with minSICN > 0.7: 71.58 %
 8//    * # elements with minSICN < 0.2: 0.0 %
 9 
10// minSIGE: 
11//---------- 
12//    * average minSIGE: 0.8066
13//    * # elements with minSIGE > 0.7: 83.69 %
14//    * # elements with minSIGE < 0.2: 0.0 %
15 
16// gamma: 
17//---------- 
18//    * average gamma: 0.7157
19//    * # elements with gamma > 0.6: 78.49 %
20//    * # elements with gamma < 0.2: 0.09 %

A wide variety of free and open-source solvers can directly deal with *.msh mesh files. But if your chosen solver do not, or you prefer to use a commercial software, you always can convert our provided *.msh files thanks to Gmsh software. Indeed Gmsh can export meshes in many mesh format. For example (but not limited to):

  • Abaqus INP *.inp
  • INRIA Medit *.mesh
  • Nastran bulk data files (*.bdf or *.BDF): for use with COMSOL Multiphysics®, Ansys, or many others
  • MATLAB *.m files

You can use directly the graphical user interface (GUI) of Gmsh by "File" -> "Export" or CRTL+E shortcut, or alternatively via the command line:

1gmsh -save -format "format_name" g00y000h00w.msh

where "format_name" is one of the following: msh1, msh2, msh22, msh3, msh4, msh40, msh41, msh, unv, vtk, wrl, mail, stl, p3d, mesh, bdf, cgns, med, diff, ir3, inp, ply2, celum, su2, x3d, dat, neu, m, key, off, rad.