Hi Raymundo,
Thanks for your message.
Below is the Python code I am using to import events via Brainstorm using the MATLAB engine:
imported_spikes = self.eng.bst_process(
'CallProcess', 'process_import_data_event',
output_eeg, [],
'subjectname', subject_name,
'condition', '',
'eventname', eventname_str,
'timewindow', matlab.double([]),
'epochtime', matlab.double([-0.300, 0.300]),
'createcond', 1, # Create a new folder for each matching event
'ignoreshort', 1,
'usectfcomp', 1,
'usessp', 1,
'freq', [],
'baseline', matlab.double([-0.1, -0.0017]),
nargout=1)
Here, output_eeg is the output file from process_import_data_raw, and eventname_str is a string containing the event names separated by commas (e.g., "f4, c4").
The function correctly creates the folders corresponding to the different event time instants in Brainstorm, but the returned variable imported_spikes is empty ([]).
After that, my intention is to compute the average of the imported events using:
spikesAvg = self.eng.bst_process(
'CallProcess', 'process_average',
imported_spikes, [],
'avgtype', 3,
'avg_func', 1,
'weighted', 0,
'keepevents', 0,
nargout=1)
However, since imported_spikes is empty, no average is generated.
So my main issue is that although process_import_data_event appears to run correctly and creates the epochs in Brainstorm, it does not return any output file to Python.
Thank you!