Hi Martin,
Thank you. I figured a workaround to get the significant channels within each ROI using apply the statistic threshold in Brainstorm and then matching the extracted channels with pre-selected channels in 6 ROI using intersect() in MatLab. This allows for creating montages/ROI of significant channels only.
The issue I'm having now is to run the permutation test again on only these channels within different ROI. I've stored the channels in in a 6x1 struct S in field ROI_Sig and I'm trying to run a loop through these in a permutation test. I've looked through the tutorial on scripting loops and on MatLab forums but I can't get it to run. The script runs fine on each list of channels (i.e. when I delete the loop and replace i in "ROIData = S(i).ROI_Sig" with a value 1-6). With the loop, the test will run on the first list of channels only. I attach a screenshot of the report.
% Process: Select files using search query
sFiles5 = bst_process('CallProcess', 'process_select_search', , , ...
'search', '(([name CONTAINS "HLG"] AND [name CONTAINS "bl"] AND [name CONTAINS "Avg"] AND [path CONTAINS "Subject"] AND [name CONTAINS "11_right"]))');
sFiles6 = bst_process('CallProcess', 'process_select_search', , , ...
'search', '(([name CONTAINS "CG"] AND [name CONTAINS "bl"] AND [name CONTAINS "Avg"] AND [path CONTAINS "Subject"] AND [name CONTAINS "11_right"]))');
% Process: Perm t-test equal [100ms,250ms All ROI] H0:(A=B), H1:(A<>B)
for i = 1:length(S)
ROIData = S(i).ROI_Sig
sFiles5 = bst_process('CallProcess', 'process_test_permutation2', sFiles5, sFiles6, ...
'timewindow', [0.1, 0.25], ...
'sensortypes', ROIData, ...
'isabs', 0, ...
'avgtime', 0, ...
'avgrow', 1, ...
'iszerobad', 1, ...
'Comment', '', ...
'test_type', 'ttest_equal', ... % Student's t-test (equal variance) t = (mean(A)-mean(B)) / (Sx * sqrt(1/nA + 1/nB))Sx = sqrt(((nA-1)*var(A) + (nB-1)*var(B)) / (nA+nB-2))
'randomizations', 4000, ...
'tail', 'two'); % Two-tailed
end
Best
David