Home > fmri > fsl > corr_ics.m

corr_ics

PURPOSE ^

corr_data = corr_ics(flist, ccrit);

SYNOPSIS ^

function corr_data = corr_ics(flist, ccrit);

DESCRIPTION ^

 corr_data = corr_ics(flist, ccrit);

 Correlates Independent Components (or any image volumes for that matter) in
 the list of 4D image files that are given in the cell string variable flist.
 ccrit is the correlation coefficient criterion.

 If flist consists of data for nsess sessions,
 then corr_data is an nsess X nsess cell array in which each element is a
 sparse matrix of size invol X jnvol, where invol and jnvol are the sizes of
 the 4th dimensions (ICs or time) of the ith and jth sessions in flist.  Only
 those correlations exceeding ccrit are stored in the sparse matrices.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function corr_data = corr_ics(flist, ccrit);
0002 % corr_data = corr_ics(flist, ccrit);
0003 %
0004 % Correlates Independent Components (or any image volumes for that matter) in
0005 % the list of 4D image files that are given in the cell string variable flist.
0006 % ccrit is the correlation coefficient criterion.
0007 %
0008 % If flist consists of data for nsess sessions,
0009 % then corr_data is an nsess X nsess cell array in which each element is a
0010 % sparse matrix of size invol X jnvol, where invol and jnvol are the sizes of
0011 % the 4th dimensions (ICs or time) of the ith and jth sessions in flist.  Only
0012 % those correlations exceeding ccrit are stored in the sparse matrices.
0013 %
0014 
0015 % 10/19/05 Petr Janata - extracted from an earlier script for doing this
0016 
0017 nsess = length(flist);
0018 
0019 for isess = 1:nsess
0020   isess_fname = flist{isess};
0021 
0022   % Get the size of the 4th dimension
0023   [dummy, tmpstr] = unix(sprintf('avwnvols %s', isess_fname));
0024   invol = str2num(tmpstr);
0025   
0026   for jsess = isess:nsess
0027     jsess_fname = flist{jsess};
0028     
0029     % Get the size of the 4th dimension
0030     [dummy, tmpstr] = unix(sprintf('avwnvols %s', jsess_fname));
0031     jnvol = str2num(tmpstr);
0032     
0033     unix_str = sprintf('avwcc %s %s %1.2f', isess_fname, jsess_fname, ccrit);
0034     fprintf('%s\n', unix_str);
0035     [dummy, tmpstr] = unix(unix_str);
0036     [iidx, jidx, ccval] = strread(tmpstr(1:end-1),'%d%d%f','delimiter',' ');
0037     corr_data{isess,jsess} = sparse(iidx,jidx,ccval,invol,jnvol);
0038     corr_data{jsess,isess} = sparse(jidx,iidx,ccval,jnvol,invol);
0039   end % for jsess
0040 end % for isess
0041 
0042 return

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