Home > fmri > utils > get_spm_flist.m

get_spm_flist

PURPOSE ^

flist = get_spm_flist(srcdir);

SYNOPSIS ^

function flist = get_spm_flist(srcdir,srcstub)

DESCRIPTION ^

 flist = get_spm_flist(srcdir);

 Gets listing of .img files in a directory and returns a cell array suitable
 for passing to SPM5 routines

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function flist = get_spm_flist(srcdir,srcstub)
0002 % flist = get_spm_flist(srcdir);
0003 %
0004 % Gets listing of .img files in a directory and returns a cell array suitable
0005 % for passing to SPM5 routines
0006 
0007 % 02/14/06 Petr Janata
0008   
0009 if nargin < 2
0010   srcstub = '*.img';
0011 end
0012   
0013 dirlist = dir(fullfile(srcdir,srcstub));
0014 nfiles = length(dirlist);
0015 flist = [repmat(srcdir,nfiles,1) repmat('/',nfiles,1) ...
0016       strvcat(dirlist.name)];  %  repmat(',1',nfiles,1)
0017 %flist = cellstr(flist);

Generated on Sat 25-May-2019 04:00:51 by m2html © 2003