Or you could use one Matlab commands e.g.
d = uigetdir; % uses a GUI to select the
directory you want
f = dir(fullfile(d,'beta_*'); % f is now a structure array
containing files in directory d starting with beta_
fnames = {fullfile(d,f.name)}; % fnames is then a cell array containing
all the file names (including path) starting with beta_
% fnames = {f.name}; is the
same without the path
Phil
Struiksma, M. (Marijn) wrote:
> Dear SPM'ers,
>
> I am writing a script to compute average parameter estimates in an ROI.
> In order to do that I need to select the appropriate beta-files. I have
> used the spm_select function as follows:
>
> betaFile=spm_select(1,'image','',[subj_dir{i},'beta_',sprintf('%4.4i',n)
> ,'.img ']);
>
> This works fine, but I still have to press done each time a file is
> selected. Is there a way to avoid the clicking? There are a few hundred
> beta-files that need to be selected and I don't want to click a few
> hundred times.
>
> Thanx!
>
> Marijn
>
--
Dr Phil Clatworthy
MRC Clinical Research Training Fellow
R3 Neurosciences
Box 83, Addenbrooke's Hospital
Hills Road, Cambridge CB2 2QQ, UK
Ext. 58401 (01223 348401)
|