Home > fmri > fsl > setup_fsl_con.m

setup_fsl_con

PURPOSE ^

fsf = setup_fsl_con(fsf, conlist, Fconlist);

SYNOPSIS ^

function fsf = setup_fsl_con(fsf, ev_names, conlist, Fconlist)

DESCRIPTION ^

 fsf = setup_fsl_con(fsf, conlist, Fconlist);

 Populates fields in the fsf contrast structures given the contrast
 information in conlist and Fconlist.

 ev_names - names of explanatory variables
 conlist - cell array in which each element is specifies the name of the ev to
           use for a t-test
 Fconlist - cell array in which each element is a cell array containing a list
            of EVs to use for the F-test

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fsf = setup_fsl_con(fsf, ev_names, conlist, Fconlist)
0002 % fsf = setup_fsl_con(fsf, conlist, Fconlist);
0003 %
0004 % Populates fields in the fsf contrast structures given the contrast
0005 % information in conlist and Fconlist.
0006 %
0007 % ev_names - names of explanatory variables
0008 % conlist - cell array in which each element is specifies the name of the ev to
0009 %           use for a t-test
0010 % Fconlist - cell array in which each element is a cell array containing a list
0011 %            of EVs to use for the F-test
0012 
0013 % 11/03/05 Petr Janata
0014 
0015 fsf.con = create_con('real');  % specify structure
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 % I don't currently handle orig vs real contrasts very well
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

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003