The purpose of this page is just to serve as todo or scratch pad for the development project and to list and share some ideas.

After making changes to the code and/or documentation, this page should remain on the website as a reminder of what was done and how it was done. However, there is no guarantee that this page is updated in the end to reflect the final state of the project

So chances are that this page is considerably outdated and irrelevant. The notes here might not reflect the current state of the code, and you should not use this as serious documentation.

Dealing with the geometry of the forward model

This part overviews the available routines (and not yet available too!) to get an optimal description of the head geometry in order to build a forward model.

The functions’ types available at the moment deal with different types of object

  • anatomies: from MRI or CT scans (for example). They are volumetric matrices
  • segmentations: they are volumetric binary masks of tissue compartments
  • surfaces: triangulations (faces and nodes) of anatomical surfaces. Normally from anatomies or segmentations
  • meshes: they are 3D meshes (nodes and elements) describing a wireframe structure. Used in FEM, FDM methods can be tetrahedrons, hexahedra (cubes) or others
  • head models: a structure containing the necessary information to run a forward model algorithm (geometry+conductivity+others)

  • The from (rows)-to (columns) matrix
^ ana ^ seg ^ surf ^ mesh ^ hdm              
1.ana 11 12 10 n.a. n.a.    
2.seg n.a. 13:-   10 14:-   3
3.surf n.a. 4 15 16:-   5  
4.mesh n.a. 8 7:-   9 6  
5.hdm n.a. 1 2:-   n.a. n.a.  

method 1

From hdm TO seg ft_prepare_sourcemodel Back

method 2

From hdm TO surf headmodel Back

method 3

From seg TO hdm ft_headmodel_fdm_fns, used only for the available FDM method Back

method 4

From seg TO surf bounding_mesh

Idea for a further improvement: Use as: ft_datatype(gris,’datatype’,’seg’) where grid comes from the ft_prepare_sourcemodel function. This generates a surface outside a delimiting filled volume.

Back

method 5

From surf TO hdm all ft_headmodel_XXX functions Back

method 6

From mesh TO hdm ft_headmodel_fem_simbio, used only for the available FEM method Back

method 7

From mesh TO surf TBD Useful for example to extract a surface from the wireframe Implementation suggestion of mesh2surf.m: for each triangle of the tetrahedron count the number of belonging tetrahedra end keep the triangles with count == 1 Back

method 8

From mesh TO seg TBD Useful for example to calculate if source points ly in or out of a wireframe element Back

method 9

From mesh TO mesh TBD Useful to reposition the elements elastically Back

method 10

From seg TO surf ft_surfaceextract Back

method 11

From ana TO ana spm_smooth or ft_volume_realign Back

method 12

From ana TO seg ft_volumesegment Back

method 13

From seg TO seg All morphological operators, e.g., imopen Back

method 14

From seg TO mesh Builds a mesh directly from the segmentation, like in vgrid software Back

method 15

From surf TO surf Manipulates surfaces: all ft_surfaceXXX functions Back

method 16

From surf TO mesh Tetge software, interfaced by the external toolbox iso2mesh Back

method ?

From ? TO ? TBD Back