Error using db_parse_subject

Hello everyone,

I've been looking for a solution to my problem on the forum but I'm stuck. If anyone has an idea on how to fix this: I'm unable to reload my protocol... Thanks in advance for any help!

The error :

nrecognized field name "BrainStormSubject".

Error in **[db_load_studies](matlab:matlab.lang.internal.introspective.errorDocCallback\('db_load_studies', 'C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\db\db_load_studies.m', 107\))** ([line 107](matlab: opentoline\('C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\db\db_load_studies.m',107,0\)))
\[fpath\_, newDirName\] = bst_fileparts(studyMat.BrainStormSubject);
^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in **[db_reload_database](matlab:matlab.lang.internal.introspective.errorDocCallback\('db_reload_database', 'C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\db\db_reload_database.m', 77\))** ([line 77](matlab: opentoline\('C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\db\db_reload_database.m',77,0\)))
db_load_studies(0, isFix);
^^^^^^^^^^^^^^^^^^^^^^^^^
Error in **[db_load_protocol](matlab:matlab.lang.internal.introspective.errorDocCallback\('db_load_protocol', 'C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\db\db_load_protocol.m', 94\))** ([line 94](matlab: opentoline\('C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\db\db_load_protocol.m',94,0\)))
db_reload_database(iProtocols(i));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in **[gui_brainstorm>SetCurrentProtocol](matlab:matlab.lang.internal.introspective.errorDocCallback\('gui_brainstorm>SetCurrentProtocol', 'C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\gui\gui_brainstorm.m', 1054\))** ([line 1054](matlab: opentoline\('C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\gui\gui_brainstorm.m',1054,0\)))
db_load_protocol(iProtocol);
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in **[gui_brainstorm](matlab:matlab.lang.internal.introspective.errorDocCallback\('gui_brainstorm', 'C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\gui\gui_brainstorm.m', 34\))** ([line 34](matlab: opentoline\('C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\gui\gui_brainstorm.m',34,0\)))
eval(macro_method);
^^^^^^^^^^^^^^^^^^
Error in **[gui_edit_protocol/updateProtocolModificiations](matlab:matlab.lang.internal.introspective.errorDocCallback\('gui_edit_protocol/updateProtocolModificiations', 'C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\gui\gui_edit_protocol.m', 180\))** ([line 180](matlab: opentoline\('C:\Users\libre-irisse\Desktop\brainstorm3\toolbox\gui\gui_edit_protocol.m',180,0\)))
gui_brainstorm('SetCurrentProtocol', iProtocol);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Hi @Flo7,

It seems there is something wrong with the structure of your Protocol dir, from either a Matlab crash or a manual manipulation of the files.

Now it’s something that has to be fixed manually.
Before you try to fix anything, make a complete backup of all your database if it is not already done. A manipulation error could lead to massive loss of data.

The structure you should have for the protocol is described here:
https://neuroimage.usc.edu/brainstorm/Tutorials/Database#On_the_hard_drive

In your case, it seems there is a file brainstormstudy.mat at the level Protocol_X/data
Is that what you see on your files?

Dear Raymondo,

Thank you for your response and for your help. I found a 'brainstudy.mat' file for every subject, which contains the following data

This could be helpful? Thank again

F

The content you posted corresponds to a file with name brainstormsubject.mat and not the file brainstudy.mat. Can you confirm this?

Yes, sorry—I do have these files, but they are organized as one file per subject. Inside, this is what I found. Thanks again so much for the help!

That is not correct. There should be one file per Study
image

It seems you have a file in /data/brainstormstudy.mat, that is causing the troubles at reading the Protocol