0001 function fsf = setup_fsl_con(fsf, ev_names, conlist, Fconlist)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 fsf.con = create_con('real');
0016
0017 nev = length(ev_names);
0018
0019 ncon = length(conlist);
0020 conmtx = zeros(ncon,nev);
0021 for icon = 1:ncon
0022 con = create_con('real');
0023 con.conname = conlist{icon};
0024
0025 targ_col = strmatch(conlist{icon},ev_names,'exact');
0026 conmtx(icon,targ_col) = 1;
0027
0028 con.con_vect = conmtx(icon,:);
0029
0030 fsf.con(icon) = con;
0031 end
0032
0033 fsf.ncon_real = sum(strcmp('real',{fsf.con.type}));
0034 fsf.ncon_orig = sum(strcmp('orig',{fsf.con.type}));
0035
0036 fsf.Ftest = [];
0037
0038 nF = length(Fconlist);
0039
0040 fsf.nftests_real = nF;
0041
0042
0043 Fconmtx = zeros(ncon,nF);
0044 for ifcon = 1:nF
0045 [conmask, con_idxs] = ismember(Fconlist{ifcon}, {fsf.con.conname});
0046 if all(conmask)
0047 for icon = 1:length(con_idxs)
0048 if isempty(fsf.con(con_idxs(icon)).ftest)
0049 fsf.con(con_idxs(icon)).ftest = zeros(1,nF);
0050 end
0051 fsf.con(con_idxs(icon)).ftest(ifcon) = 1;
0052 end
0053 end
0054 end