Dear Brainstorm Team,
I am currently trying to create a new protocol and subject by calling Brainstorm functions from Python, but I have encountered some issues when attempting to activate the subject.
I have successfully created and activated the protocol, and then added a new subject using:
self.eng.eval(f"db_add_subject('{subject_name}');", nargout=0)
However, I have not found a reliable way to correctly activate the subject so that the files I will import next are correctly associated with it.
I found this function:
bst_set('Subject', iSubject, sSubject)
which I thought could work, but I have not been able to obtain sSubject or iSubject.
When I try:
sSubject, iSubject = self.eng.bst_get('Subject', 'SubjectName', nargout=2)
it returns an invalid (empty) result.
Also, in my code, the function:
ProtocolInfo = self.eng.bst_get('ProtocolInfo')
works correctly, but when I try to run
ProtocolSubjects = self.eng.bst_get('ProtocolSubjects')
it raises the error: ““Only struct can be returned from MATLAB.”
Could you please help me find the proper way to activate the subject?
Thank you very much for your help,
Claudia