I'll look at this and check if we can recompile the source code with the missing libraries. However, this may take a little time since all the dependencies may need to be checked before running the cross-compilation for Windows.
Any help or guidance is greatly appreciated.
The faster solution is to use the Duneuro source code; you can find all the code and documentationentation here:
I was able to compile and run duneuro from source and solve the forward model. Is there a way to import duneuro's output back into brainstorm so I can continue my analysis (e.g. solve inverse problem)? Are there any functions that were created to get the duneuro output to work with brainstorm.
I was able to compile and run duneuro from source and solve the forward model.
It is great to hear that you could run the duneuro from the source code. Were you able to integrate the dune-subgrid module? It will also be great to share here the steps you follow to solve the issue so that interested users can benefit from it.
Is there a way to import duneuro's output back into brainstorm so I can continue my analysis (e.g. solve inverse problem)?
Yes, you can, but there is no dedicated function to do it in Brainstorm right now.
All depends on the format of the LF that you have obtained, is it in Matlab? Python? txt/binary file?
You mainly need to read the Gain matrix [leadfieldfield matrix], which has Nchannel x 3*Nsource, and then import it to Brainstorm.
You need to make sure that all the links to the surface file and channel files are set correctly in the HeadModel file.
A fast solution is to compute a mock head model (not adapted geometry) using the same FEM model (tetra), same source model (cortex), and same channel file, and then export it to Matlab, replace the Gain matrix with the one you computed from Duneuro and then import it back to Brainstorm.
Here is the format of the headmodel that you need to change: https://neuroimage.usc.edu/brainstorm/Tutorials/HeadModel#On_the_hard_drive
I've found after running duneuro from source, that I get the same error (missing dune-subgrid) as in bst's duneuro plugin. This only occurs when I have the parameter "geometry_adapted = True" set in the config when defining the MEEGDriver3d. I tried to find documentation for this parameter from duneuro wiki but there is no information on it. The section that explains how to create a driver (Create a driver · Wiki · duneuro / duneuro · GitLab) does not mention of this parameter. Everything works when I do not include this parameter when defining the driver.
My question is if this parameter is required when running bst's duneuro? If this parameter is removed from the 'duneuro_minifile.mini' file that is created and used to run duneuro from bst, then it should fix the issue mentioned in this thread.
RuntimeError: Dune::Exception [findEntityImpl:/home/andy/Dune/duneuro/duneuro/common/edgehopping.hh:84]: coordinate is outside of the grid, or grid is not convex
I have checked that all the dipoles from the source grid is inside the grey matter (of the mesh). I am solving this in duneuro (standalone) by looping through each dipole within the source grid and solving using solveEEGForward(). This error only pops up at a certain dipole point. I checked the dipole that it stops at and found that it typically occurs when the dipole is located at the boundary of the grey matter (interface between grey matter and csf).
I have also tried this using bst-duneuro plugin and the same error occurs.
Sorry for the late response; I missed this last message.
Have you checked visually the position of your source space with regards to the FEM mesh?
Have you checked the box "Force inside the GM" when running the FEM?
Can you share a view of the FEM mesh and the source space, you can play with the surface tab and change the color of the source space (cortex) once displayed together with the FEM mesh.