Hi, I would like to produce a script with a subtraction of ERPs subject by subject, across different conditions, e.g.: condition1 subject1 - condition2 subject1, condition1 subject2 - condition2 subject2 etc. (and in some cases I need to subtract the ERPs with an opposite sign, which contain a word "| opposite" after the timestamp which I need to keep not to confuse with the original ERPs since both are in the same directory).
When I try to adapt the script produced by brainstorm, subject names contain timestamps which are unpredictable. Using * instead of the last part of timestamps does not get recognized by brainstorm. How can I proceed to ignore these timestamps?
Here is an example of my script:
% Script generated by Brainstorm (24-Apr-2020)
% Input files
sFiles = {...
'erps_s0001/xxx/data_210316_2118.mat'};
sFiles2 = {...
'erps_s0001/xxx/data_210316_2118_opposite.mat'};
% Start a new report
bst_report('Start', sFiles);
% Process: Difference: A-B
sFiles = bst_process('CallProcess', 'process_diff_ab', sFiles, sFiles2);
% Save and display report
ReportFile = bst_report('Save', sFiles);
bst_report('Open', ReportFile);
% bst_report('Export', ReportFile, ExportDir);
I am trying to change it into:
% Input files
sFiles = {...
'erps_s0001/xxx/data*.mat'};
sFiles2 = {...
'erps_s0001/xxx/data*opposite.mat'};
- but it doesn't work.
Eventually I would like to enter all subjects in the loop (but so that the subtraction occurs subject by subject).
Thanks a lot for your help!!