I have an issue that is specific to one of my protocol (not observed in other protocols): I get a "Struct contents reference from a non-struct array object" error on every process and every file. The new files are created, but I have to reload the subject to see them. I tried to reload and to detach/load the database but the problem remains.
What can I do to fix the issue?
Thanks for your help,
First make sure Brainstorm is up to date (some recent changes in the new search features can cause errors).
Otherwise, please post the full error message, so we can try to guess what has gone wrong with your protocol.
Brainstorm is up to date. The message is consistently this. Note that files are still created and appear when I reload the database.
** Error: Line 278: Struct contents reference from a non-struct array object.
** Call stack:
** >bst_process.m>Run at 278
** >bst_process.m at 36
** >panel_process1.m>RunProcess at 151
** >panel_process1.m at 26
** >gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 772
** >bst_call.m at 28
** >gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 296
I guess there is something corrupted in the structure of the database. Some file or folder was registered in the database with an unexpected value OR there is something particular in the protocol path that make one of the functions fail (space or special characters?)
The easiest would be for you to debug it in place: put a breakpoint in bst_process.m at line 271 (click at the right of the line number in the Matlab editor), and then step into function GetInputStruct() and follow line by line (button "step over") what is happening with the variables, and see why this call is returning something that is not a structure (which causes the crash at line 278).
The debugger is relatively easy to use, a quick video tutorial could teach you how to use it.
If you can't understand what is going on and you want me to try debugging it, I'd need an example dataset. Prepare a minimal dataset with which you can reproduce the error.
Duplicate one subject of your protocol, delete all the files that are not needed to reproduce the error, right-click on the subject > File > Export subject. Then load the generated .zip file as a new protocol (menu File > Load protocol > Load from zip file) and make sure the error still occurs. Upload this zip file somewhere and share the download link here.
I used debugging up to line 278, then the function bst_call(varargin) is called and crashed on line 32. The variable that is created, ‘varargin’, contains “@createwindow/ProcessRun_Callback”.
Unfortunately, this is not very informative.
When the execution cursor is at line 271, click on "Step in" to go explore function GetInputStruct. Go through this function line by line to understand why what is returned by this function is not a struct.
(which is a reason why it crashes at line 278)
(I guess you've already checked that you don't have any other parasite function in your Matlab path? If you have anything else than MATLAB-related stuff: delete it, and save the path permanently)
I did a reset of my path but the problem remains.
Using "Step in" at line 271 led me to java_call.m, line 45 (javaMethodEDT) before it crashed.
You mean that the debugger is stopped at line 271, you click on the button "Step in" and you java_call?
This doesn't make much sense...
If you can't debug this, I'm not sure how to help you further...
Have you tried on a different computer?
Make a full copy of your protocol and delete the files one by one to see what causes your problem.
Or give me a teamviewer access to your computer and I can try to debug it directly there.
I noticed that in addition to the "Group analysis" folder, I have another "Groupe analysis/Unnamed" folder I cannot delete in the database. Maybe this is causing this issue. Do you know how I could manually deleted this folder? It is not a physical folder and right-click/file/show in explorer lead me nowhere.
Something has gone wrong in your database, probably caused by wrong manipulations, I can't tell you what or why.
If you want to give me access to your computer remotely, I could try to see if there is anything obvious I can detect. Otherwise, I'm not sure how I can help you...
I downloaded your files.
Do you really have put the anat and data protocol folder in the same folder?...
You should never have both @default_subject and @default_study in the same folder.
Look at the example of the protocol that works in comparison. Move and the files accordingly, then delete protocol .mat and load the protocol again.
I have not modified any file or folder. I tried moving the folders in anat and data folders but the database is now empty and nothing happens when I reload the protocol.
Also, where should the "core" file go? In data?
How did you manage to create a protocol with data folder = anat folder?
This is most likely the source of most of your problems...
This "core" file does not belong to Brainstorm, it was created by some program that crashed on your computer.
No idea, that's not something I asked for.
Now the database appear as empty in the GUI and nothing happen when I reload the database.
I don’t know what to tell you... it looks like you are in an abnormal configuration, something that the software is not designed to handle (data=anat)
If you don’t know how to debug this yourself, either you reimport everything with a correct configuration, or you give me access to you computer so I can a look and see if I can fix this in 5min...