Brainstorm Startup Error using jsondecode

Dear all,

Would you please let me know how I should fix this error?

>> brainstorm
 
BST> Starting Brainstorm:
BST> =================================
BST> Version: 10-Jul-2024
BST> Compiling main interface files...
BST> Deleting old process reports...
BST> Loading configuration file...
BST> Checking internet connectivity... ok
BST> Initializing user interface...
Error using jsondecode
JSON syntax error at line 1, column 49 (character 49): escape character '\U' is not valid.

Error in bst_jsondecode (line 66)
    outStruct = jsondecode(inString);

Error in bst_plugin>GetSupported (line 660)
        PlugUserDesc = bst_jsondecode(plugJsonText);

Error in bst_plugin>MenuCreate (line 2522)
    PlugDesc = GetSupported();

Error in bst_plugin (line 113)
eval(macro_method);

Error in gui_brainstorm>CreateWindow (line 174)
        jMenusPlug = bst_plugin('MenuCreate', jMenuPlugins, [], fontSize);

Error in gui_brainstorm (line 34)
eval(macro_method);

Error in gui_initialize (line 30)
GlobalData.Program.GUI = gui_brainstorm('CreateWindow');

Error in bst_startup (line 376)
gui_initialize();

Error in brainstorm (line 123)
        bst_startup(BrainstormHomeDir, 1, BrainstormDbDir);

This is caused by incorrect .json file for a user-defined plugin in the plugin folder in your User directory

https://neuroimage.usc.edu/brainstorm/Tutorials/Plugins#User-defined_plugins

To fix the issue, fix the .json file for the user-defined plugin.

How was the user-defined plugin added to Brainstorm?

1 Like

Thank you for your response. I wanted to add manually EEGLAB to brainstorm and after adding URL of EEGLAB, I faced with this error.

@behnamghabel76, be aware that having Brainstorm and EEGLab functions in the Matlab path could cause troubles, as functions can be shadowed. This is to say, when two or more functions with the same name are on Matlab path, the function in the directory higher up the path gets called, and therefore shadows the function lower in the path.

Thank you for your information. Would you please let me know how should I fix the .json file since I do not have writing code skills.

Best,

First, Why do you want to have EEGLab as a Brainstorm plugin?

If you are not familiar with plugins in Brainstorm, I'd suggest you to delete that .json file.
And only add EEGLab to the path when needed

I wanted to add EEGLAB to Brainstorm to use the EEGLAB plugin (called TESA) in the Brainstorm.
I completely deleted the brainstorm directory and also Matlab software and installed it again but I do face this error even when I delete JSON file I face this error that JSON file is missed.

You need to delete the .json file from your the plugins directory in your user directory

https://neuroimage.usc.edu/brainstorm/Tutorials/CreateProtocol#Brainstorm_folders

Is this a different error message?
If it is please included the entire error message

>> brainstorm
 
BST> Starting Brainstorm:
BST> =================================
BST> Version: 10-Jul-2024
BST> Compiling main interface files...
BST> Deleting old process reports...
BST> Loading configuration file...
BST> Loading default montages...
BST> Checking internet connectivity... ok
BST> Initializing user interface...
Unrecognized function or variable 'bst_jsondecode'.

Error in bst_plugin>GetSupported (line 660)
        PlugUserDesc = bst_jsondecode(plugJsonText);

Error in bst_plugin>MenuCreate (line 2522)
    PlugDesc = GetSupported();

Error in bst_plugin (line 113)
eval(macro_method);

Error in gui_brainstorm>CreateWindow (line 174)
        jMenusPlug = bst_plugin('MenuCreate', jMenuPlugins, [], fontSize);

Error in gui_brainstorm (line 34)
eval(macro_method);

Error in gui_initialize (line 30)
GlobalData.Program.GUI = gui_brainstorm('CreateWindow');

Error in bst_startup (line 376)
gui_initialize();

Error in brainstorm (line 123)
        bst_startup(BrainstormHomeDir, 1, BrainstormDbDir);
 
>>

Did you deleted the file bst_jsoncode.m file from the folder with Brainstorm code?
If you did, download again Brainstorm from the link below. I have added some code to handle ill defined .json files.

https://neuroimage.usc.edu/bst/download.php

Thank you very much for your help. It works now