-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_channelRespAmp.m
64 lines (45 loc) · 2.09 KB
/
run_channelRespAmp.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
% run_channelRespAmp.m
%
% UPDATED 2/23/2018 - now loops over a list that's generated containing all
% analyses to run, and assigns them in whatever order parfor decides.
% should be ~2x as quick, if not faster (no bottleneck on some subj, etc)
%subj = {'AY','CC','EK','KD','MR','XL','SF'};
subj = {'AY','CC','MR'};
%sess = {{'spDist1','spDist2'},{'spDist1','spDist2'},{'spDist1','spDist2'},{'spDist1','spDist2'},{'spDist1','spDist2'},{'spDist1','spDist2'},{'spDist1','spDist2'}}; % the set of sessions to be run on EVERYONE in subj...
sess = {{'spDistLong1','spDistLong2'},{'spDistLong1','spDistLong2'},{'spDistLong1','spDistLong2'}}; % the set of sessions to be run on EVERYONE in subj...
ROIs = {'V1','V2','V3','V3AB','hV4','VO1','VO2','LO1','LO2','TO1','TO2','IPS0','IPS1','IPS2','IPS3','sPCS','iPCS'};
which_vox = 0.1; % 10% VE thresh
shuf_iter = 1000;
% which analyses to run on everyone?
% - 1 = spDist_channelRespAmp_fixTrn.m and shuffled
% - 2 = spDist_channelRespAmp_GATdist.m
which_analyses = [2]; % specify which analyses to run on eveyrone (MGSMap)
to_run = nan(length(subj)*length(ROIs)*length(which_analyses),4);
thisidx = 1;
for ss = 1:length(subj)
for rr = 1:length(ROIs)
for aa = 1:length(which_analyses)
to_run(thisidx,:) = [ss ss rr which_analyses(aa)];
thisidx = thisidx+1;
end
end
end
% to_run is:
% 1) SUBJ
% 2) SESS
% 3) ROI
% 4) ANALYSIS
n_threads_per_core = 18;
ncores = floor(feature('numcores')/n_threads_per_core);
mypool = parpool(ncores); % use all possible cores
parfor ii = 2 %1:size(to_run,1)
maxNumCompThreads(n_threads_per_core);
if to_run(ii,4) == 1
spDist_channelRespAmp_fixTrn( {subj{to_run(ii,1)}},{sess{to_run(ii,2)}},{ROIs{to_run(ii,3)}},which_vox,7:15)
spDist_channelRespAmp_fixTrn_shuf({subj{to_run(ii,1)}},{sess{to_run(ii,2)}},{ROIs{to_run(ii,3)}},which_vox,7:15,shuf_iter)
elseif to_run(ii,4) == 2
spDist_channelRespAmp_GATdist( {subj{to_run(ii,1)}},{sess{to_run(ii,2)}},{ROIs{to_run(ii,3)}},which_vox)
end
end
delete(mypool);
maxNumCompThreads('automatic');