I recently encountered this same error in Brainstorm version 08-Jul-2025 while working on an automation script for my EEG analysis. This was the initial error thrown by my Matlab script after I had made some seemingly trivial edits:
org.brainstorm.tree.BstNode[] is not assignable to org.brainstorm.tree.BstNode[]
Error in node_create_study (line 553)
CreatedNodes(iCreatedNode) = parentNode.add(allNodes(iNode).type, ...
Error in panel_protocols>UpdateNode (line 690)
node_create_study(nodeStudy, [], sStudy, iStudy, isExpandTrials, UseDefaultChannel, iSearch);
Error in panel_protocols (line 46)
eval(macro_method);
Error in bst_process>Run (line 320)
panel_protocols('UpdateNode', 'Study', iStudyToRedraw);
Error in bst_process>CallProcess (line 2329)
OutputFiles = Run(sProcess, sInputs, sInputs2, 0);
Error in bst_process (line 38)
eval(macro_method);
Error in SSVEP_Analysis (line 157)
sFiles = bst_process('CallProcess', 'process_fft', sFiles, [], ...
Until any analysis files that had been created by the script are deleted and the protocol is reloaded, the files nested within the condition I attempted to analyze fail to load and this error constantly pops up in the brainstorm gui:
** Error: Line 553: org.brainstorm.tree.BstNode[] is not assignable to org.brainstorm.tree.BstNode[]
**
** Call stack:
** >node_create_study.m at 553
** >panel_protocols.m>CreateStudyNode at 577
** >panel_protocols.m at 46
** >tree_callbacks.m at 113
** >bst_call.m at 28
** >panel_protocols.m>CreatePanel/protocolTreeClicked_Callback at 128
** >bst_call.m at 28
** >panel_protocols.m>@(h,ev)bst_call(@protocolTreeClicked_Callback,h,ev) at 75
Worst of all, the error was following me around, with every condition I attempted to analyze seeming becoming corrupted, failing to load, throwing the above error, and making brainstorm very difficult to use.
After several days of trouble shooting, confusion, creating new protocols, and deleting old analysis files, I finally found the source of the error: when I had run my fast Fourier transform in my script, I defined the electrode variable that passed to the sensortypes argument as "EEG" rather than 'EEG'. Here is an example of code that causes the error:
% Process: Fourier transform (FFT)
sFiles = bst_process('CallProcess', 'process_fft', sFiles, [], ...
'timewindow', window, ...
'units', 'physical', ... % Physical: U2/Hz
'sensortypes', "EEG", ...
'avgoutput', 1);
Using doubles quotation marks rather than single quotation marks in this context creates corrupted data and renders Brainstorm essentially unusable until the created data is deleted and the protocol is reloaded.
I wanted to share this error and its cause in the hopes that future versions of Brainstorm may be made more robust to use of character variables versus string variables when scripting, or at the very least, produce errors that are actually informative when the wrong variable type is used.