Open mdovgialo opened 3 months ago
First try of decomposing the FSAVERAGE into materials:
Made a first prototype of converting MRI to a 3D mesh with appropriate format conversions of materials and boundary elements grounding plate definition. Untested yet.
Some hacks still to be fixed, also MFEM complains about
Elements with wrong orientation: 16777216 / 16777216 (NOT FIXED)
Not sure what it's about, need to see how it will simulate...
Fixed elements with wrong orientation by first resampling MRI segmentation to RAS instead of weird skewed/inverted thing
First results of forward modeling! First try on lower resolution with 2mm voxels (around 2 million cubes), 1 mm is 16 million...
Head in air with ground plate:
Volume colors - materials Boundary - yellow grounding plate, green just a border
GT:
Simulated potential:
Higher contrast:
Seems to be working?
Solution parameters
grid step: 5 mm R_init: 12 mm
1 mm mesh used to simulate potential to electrodes, fsaverage Electrodes 3 layers of 10-05
kESI and kCSD solutions are remarkably similar, differences are on the order of 0.001%!!!! Maybe worth trying computing a higher resolution solution?
Colors changed for easier readability when showing CSD solution and GT
solution grid step: 1mm solution basis source radius: 1.2 mm
lambda chosen by CV
ZERO!!! WHAT???
solution grid step: 1mm solution basis source radius: 1.2 mm
lambda chosen by CV
ZERO!!! WHAT???
solution grid step: 5mm solution basis source radius: 12 mm
lambda chosen by CV
Very low differences!
solution grid step: 5mm solution basis source radius: 12 mm
lambda chosen by CV
Very low differences!
Maybe something is wrong with corrections? How corrections are used? Maybe they need normalisation?
Just in case looking at electrode corrections.
Theoretical potential of a point current source at electrode position, with sigma=0.33, without FEM mesh influence
Potential of a point current source at electrode position, calculated over 2mm mesh with realistic materials
FEM potential minus theoretical
Use FSSurface with parcelation to create material segmentation of FSAverage scan to white matter, grey matter, CSF, skull, skin, air
FSaverage has brain segmentation, but it seems skin and skull surfaces are only available as .surf files. Faces were scrambled, there is also no cavities.
.surf files can be read by MNE and converted to .obj. Pyvista can read .obj and has filters to select points which are inside of the surface.
create scripts to convert such segmented MRI into a mesh made out of cubes with properly assigned materials, and try to simulate something?
Try to create a cube mesh using the 4 spheres sampled materials, and compare 4 spheres conforming mesh and the cube mesh solutions?
Additional information and tools to segment MRI scans into tissues:
https://link.springer.com/article/10.1007/s12021-020-09504-5#rightslink
https://github.com/gtaberna/mrtim/wiki
TODO: Add far boundary mesh option