Hi
I have to adjust my triggers for stimulation delays. I saw the option for doing this through Brainstorm (Events>time offset) but this seems to require the same offset correction across trials. I have data from a cognitive task which has 4 categories (original_11, original_12, original_21 & original_22), each with a 100 trials so a total of 400 trials per subject. The offset delay varies from trial to trial. Could you advise how I can amend individual trials?
I have the delay for each trial for each subject stored in a table 'T'. T.Subject has all subject IDs (400 rows for each subject), T.Conditions has the categories (11, 12, 21 & 22 (100 rows per category)), T.Trial lists the number of the trial in each category (1-100) and T.Delay has all the delays that the 'original' time stamp has to be corrected for. I looked at doing this through MatLab but I'm not sure how to match between a table and a struct so trials are altered appropriately?
sFiles = bst_process('CallProcess', 'process_select_search', sFiles, [], ...
'search', '(([name CONTAINS "resample"]))');
for iFile = 1:length(sFiles)
DataMat = in_bst_data(sFiles(iFile).FileName);
original_11 = DataMat.F.events(1).times
original_12 = DataMat.F.events(2).times
original_21 = DataMat.F.events(5).times
original_22 = DataMat.F.events(6).times
end
sample rows form T
T =
Subject Conditions Trial Delay
"Subject008" 11 95 83
"Subject121" 12 96 84
"Subject156" 21 97 67
"Subject356" 22 98 67