No constructor with matching signature

I am getting this error
image

Edit: Problem disappeared after deleting ~\.brainstorm folder.

You probably just had to restart Matlab.

Restarting Matlab and reinstalling Brainstorm didn't help but removing ~\.brainstorm folder did.

this is happening again, restart doesnt help. this messgage appear at the start of the brainstorm

***************************************************************************
** Error: Line 548: org.brainstorm.tree.BstNode[] is not assignable to org.brainstorm.tree.BstNode[]
** 
** Call stack:
** >node_create_study.m at 548
** >panel_protocols.m>CreateStudyNode at 501
** >panel_protocols.m at 44
** >panel_protocols.m>CreatePanel/protocolTreeExpand_Callback at 176
** >bst_call.m at 28
** >panel_protocols.m>@(h,ev)bst_call(@protocolTreeExpand_Callback,h,ev) at 75
** 
***************************************************************************

BST> =================================

This happened after I tried to add tags to PSD computed on scouts

    Process: Fourier transform (FFT)
    sFiles = bst_process('CallProcess', 'process_fft', sFiles, [], ...
        'units',     'physical', ...  % Physical: U2/Hz
        'avgoutput', 1);

    % bst_report('Export', ReportFile, ExportDir);
    sFiles = bst_process('CallProcess', 'process_add_tag', sFiles, [], ...
    'tag',           tag, ...
    'output',        1);  % Add to file name

    % Process: Add tag: timewindow.condition_name
    sFiles = bst_process('CallProcess', 'process_add_tag', sFiles, [], ...
    'tag',            tag, ...
    'output',        2);  % Add to file path

        % Save and display report
    ReportFile = bst_report('Save', sFiles);
    bst_report('Open', ReportFile);
    % bst_report('Export', ReportFile, ExportDir);

Maybe the file is malformed? There is problem with loading files in browse even after removing it timefreq_fft_210205_1259.mat (425.9 KB)

Note that this is not the same error as before.

Do you have multiple versions of Brainstorm on your computer?
Make sure you remove everything that is not strictly related with the MATLAB installation from your MATLAB path.

Try creating a new empty protocol.
Do you still get this error?
If you switch back to the previous protocol, do you always get the same error?

If so, edit the function brainstorm3/toolbox/tree/node_create_study.m and add at line 547 the lines below:

allNodes(iNode)
parentNode.getType
parentNode.getFileName
parentNode.getComment

Refresh the display, and when it crashes, copy-paste the output from the Matlab command window just before the error.
Example:

ans = 
  struct with fields:
         type: 'timefreq'
      comment: 'Power,1-220Hz (ECOG, SEEG) | zscore'
     filename: 'sub-ecog01/sub-ecog01_ses-postimp_task-seizure_run-01_ieeg/timefreq_trial003_morlet_190420_1832_zscore.mat'
        iItem: 3
       iStudy: 4
      iParent: 3
     Modifier: 0
    toDisplay: 1
        iNode: []

ans =
data

ans =
sub-ecog01/sub-ecog01_ses-postimp_task-seizure_run-01_ieeg/data_seizure_trial003.mat

ans =
seizure (#3)

I have only one Brainstorm version, I update it often. Deleting .brainstorm folder together with Files folder do the job. When I open a copy of the protocol before running my code everything is ok.

After trying to debug I found that running this fragment

    % bst_report('Export', ReportFile, ExportDir);
    sFiles = bst_process('CallProcess', 'process_add_tag', sFiles, [], ...
    'tag',           tag, ...
    'output',        1);  % Add to file name
% 

before this

     % Process: Add tag: timewindow.condition_name
    sFiles = bst_process('CallProcess', 'process_add_tag', sFiles, [], ...
     'tag',            tag, ...
     'output',        2);  % Add to file path

corrupt files in the database.

What do you have in the tag variable?

The debugging procedure I proposed would still be interesting.

tag = "FFT_Destrieux"; Does FFT is a reserved word?

Also I have suggestion for developers, for decopling information about user prefererences from data related to files and protocols, debugging in situation like this is really unpleasant (every time I need to type my login and password + manually change scalling, pick databaseDB folder et cetera)

ans = 

  struct with fields:

         type: 'spectrum'
      comment: ["FFT"    " | "    "FFT_Destrieux"]
     filename: 'Subject01_A/S001_ISRASSR_20170220_01_resample/timefreq_fft_210205_1512.mat'
        iItem: 1
       iStudy: 35
      iParent: -1
     Modifier: 0
    toDisplay: 1
        iNode: []


ans =

condition


ans =

Subject01_A/S001_ISRASSR_20170220_01_resample


ans =

tag = "FFT_Destrieux"

comment: ["FFT" " | " "FFT_Destrieux"]

Your problem is here... you end up with something like an array of strings in comment...
Use only single quotes ' and not double quotes " in Matlab, for manipulating char matrices.
And yes, _FFT_ is a reserved keyword in the filenames.

1 Like

Thanks! It helped me a lot! I also program in Python, so I forgot about the importance of quotes