OpenMEEG installation error

Hi All,

Brainstorm is reporting that my version of OpenMEEG is missing or out of date. When I try to update, the tar.gz downloads but bst_openmeeg throws an error when trying to upack the file

Error using movefile
Cannot copy or move a file or directory onto itself.

I have tried downloading manually and selecting the downloaded compressed file from the Update>OpenMEEG>Install menu and get the same error,

Line 157: move file
Cannot copy or move a file or directory onto itself

the call stack is
bst_openmeeg.m at 157
bst_call.m at 28
gui_brainstorm.m>@(h, ev)bst_call(@bst_openmeeg, 'update') at 163

I am running the latest version of brainstorm (06-Nov_2016)

Thanks for any help you can offer.

KJ Jantzen

Please try the following sequence:

  • delete the openmeeg folder completely (should be in your home folder: $HOME/.brainstorm/openmeeg),
  • update Brainstorm (menu Update > Update Brainstorm)
  • start a new headmodel computation with OpenMEEG (without any manual installation before)

Let us know how it goes

Thanks Francois

I did as you suggested. When I tried to create a head model I got the message that OpenMEEG was not installed and clicked “yes” to install it after which I got the same error - see below.

For further reference, I am running Matlab 2018b on OSX 10.14.1

Error using movefile
Cannot copy or move a file or directory onto itself.

Error in bst_openmeeg (line 157)
movefile(bst_fullfile(unzipDir, ‘bin’), OpenmeegDir);

Error in bst_headmodeler (line 470)
[Gain, errMessage] = bst_openmeeg(OPTIONS);

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

Error in panel_headmodel (line 27)

Error in panel_protocols>TreeHeadModel (line 1159)
[OutputFiles, errMessage] = panel_headmodel(‘ComputeHeadModel’, iChanStudies);

Error in panel_protocols (line 44)

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

@sik @Alexandre

Was the fix below correct?

@kj_jantzen I don’t have a mac available at the moment, I cannot test this myself.
If you are familiar with Matlab, you can help us debug this:

  • open Matlab script bst_openmeeg.m
  • place a breakpoint at line 157 (click on the left of the line)
  • run the bem computation from the Brainstorm interface
  • when the debugger stops, enter the “bst_fullfile(unzipDir, ‘bin’)” and then “OpenmeegDir” in your Matlab command window to get their values
  • report these paths on this forum
  • check if they actually exist on your hard drive


I think so. I could run the epilepsy tutorial on my mac.