OpenMEEG installation

Dear expert users
I am facing several difficulties to install OpenMEEG on my Mac. I have already the BEM surfaces because I load a protocol partially pre-processed, but I have to estimate the head model for each subject. Once I try to compute the head model, OpenMEEG seems to work, it detects also the dipoles outside of the mask, but then the buffering is endless, and lastly, MATLAB gives me lots of messages of errors that I can't understand and I did not found in any existing topic.
Messages from MATLAB are:
"Unrecognized function or variable 'om_write_geom'.

Error in bst_openmeeg (line 322)
om_write_geom(geomfile, trifiles, OPTIONS.BemNames);

Error in bst_headmodeler (line 472)
[Gain_om, errMessage] = bst_openmeeg(OPTIONS);

Error in panel_headmodel>ComputeHeadModel (line 673)
[OPTIONS, errMessage] = bst_headmodeler(OPTIONS);

Error in panel_headmodel (line 27)
eval(macro_method);

Error in panel_protocols>TreeHeadModel (line 1251)
[OutputFiles, errMessage] = panel_headmodel('ComputeHeadModel',
iChanStudies);

Error in panel_protocols (line 44)
eval(macro_method);

Error in tree_callbacks>@(h,ev)panel_protocols('TreeHeadModel',bstNodes)
(line 2498)
gui_component('MenuItem', jPopup, [], 'Compute head model',
IconLoader.ICON_HEADMODEL, [],
@(h,ev)panel_protocols('TreeHeadModel', bstNodes));

RAM memory is 8GB and 21 GB of memory are still available. Might it be not enough?
Could anyone help me?
Thanks to everyone,
Best regards,

Giulia.

"Unrecognized function or variable 'om_write_geom'.

This error message indicates that OpenMEEG is not installed correctly, the executable om_write_geom is missing. Delete the folder $HOME/.brainstorm/openmeeg, and let Brainstorm re-install it automatically when running the computation.

but then the buffering is endless

What do you call "buffering"? The function om_write_geom is called at the beginning of the OpenMEEG computation (bst_openmeeg.m). Before that, it only saves the anatomy and dipoles in the folder $HOME/.brainstorm/tmp/. If this takes time, there is a problem, make sure you haven't selected the high resolution cortex surface in the subject anatomy.

Thank you very much for your reply and your assistance!
At the beginning I had manually downloaded OpenMEEG from its website because when I tried to install it automatically from brainstorm it took a lot of time. Now I deleted the folder as you suggested, but the buffering is endless, that is the batch showing "Starting OpenMEEG" when I try to compute the head model (I had already the BEM surfaces with 1922 vertices in the protocol that I loaded) lasts for a very long time... Is it normal with the surfaces already computed?
However, following the epilepsy tutorial, OpenMEEG correctly compute surfaces (1082, 642, 642 vertices), but the bug occurs when I try to compute the head model.
Thank you again for your precious support!
Greetings.

but the buffering is endless, that is the batch showing "Starting OpenMEEG" when I try to compute the head model

Please post a screen capture showing the anatomy files of your subject, and another one showing the channel file. The first steps that you report as endless should take less than a second, I suspect you selected the wrong file in the subject anatomy.

OpenMEEG correctly compute surfaces (1082, 642, 642 vertices), but the bug occurs when I try to compute the head model.

If this is the same error message as before: I already mentioned it means OpenMEEG is not installed correctly. Check where is the om_write_geom executable.

The first issue that I faced indeed, was about the MRI coregistration. Albeit the protocol have been loaded, so the co-registration between electrodes and cortex surface should have been automatically imported (I suppose), it happened this:


This is the anatomy, already computed:

While when I try to compute the head model, happen this. Following your advice, Brainstorm did not ask me again if I want to download and install Openmeeg, but starts the computation:

That will never end:

Should I Delete and re-install brainstorm too?

You need to fix the registration sensors-MRI before anything else.

While when I try to compute the head model, happen this. Following your advice, Brainstorm did not ask me again if I want to download and install Openmeeg, but starts the computation [...] That will never end

The problem is not related with the installation of OpenMEEG, but with your installation of Brainstorm.
The process aborts because it doesn't find the function om_write_geom.m, which should be in brainstorm3/external/openmeeg/.

  1. First, clean your Matlab path: Remove from the path all the folders that are not related with the installation of Matlab itself (remove all the toolboxes, including Brainstorm).
  2. Delete your brainstorm3 folder (and possibly all the versions of Brainstorm you have on your computer)
  3. Download a new version from the Brainstorm website.
  4. Close and restart Matlab
  5. Do not add brainstorm's folder to your path (as instructed in the installation instructions): https://neuroimage.usc.edu/brainstorm/Installation
  6. Go to the brainstorm3 folder and start brainstorm.m
  7. Restart the OpenMEEG computation

Following the EEG tutorial explained in the website, I have no problems, but when I try to work on an already pre-processed protocol (with BEM surfaces already computed; Yes, I am working simultaneously on two protocols, the one EEG tutorial epilepsy and the other that has been loaded) I can't do the MRI registration: I supposed that there were not the EEG positions digitized, so I added some default EEG positions available on brainstorm which best fitted into my anatomy file because in the original file that has been sent to me, there is not (or maybe I could not find electrodes positions). Anyway I don't think that in this instance it's a software's bug.

Thank you for your priceless instructions! Now the function that you mentioned is exactly where it should be, but now when I try to compute the head model on the EEG_sample epilepsy file, the system shows me this message, saying that "om_assemble can't be opened because the developer is unknown". Changing the permissions, it did non work anyway. May you have already encountered this warning message? Or could you know to manage the settings?
I will be extremely grateful if you could help me.

UPDATE:
After accepting and modifying settings for every functions that the systems did not recognize as safe, and even if it takes long time to compute it (but above all, to save in the database, I don't honestly know if it is normal), I finally managed to compute the head model, for both protocols!! Thank you very much for your efficient assistance and and your advices!!
Best regards,
Giulia.

even if it takes long time to compute it

OpenMEEG BEM computation can be long, yes.

but above all, to save in the database, I don't honestly know if it is normal

It should not take more than a few seconds to save the headmodel file in the database.
For EEG, it should not be larger than 100Mb. If it is, you should double-check which surface is selected (in green) as the default cortex surface. If it's a high-resolution surface, you may have a hard time processing sources.

It was probably a bug of my PC because this is happened just the first time that I have tried.

Yes the surfaces were very detailed so it took lot of time, but now I have managed to compute every head model that I needed!!
Thank you very much again for your assistance!
Best regards.