Hi Chris,
this is annoying, isn't it? For that particular reason I wrote a little
wrapper script that add the path name to the output (see attachment). You
call it like this: spm_lselect(dir,filt), where dir is the directory and
filt is the filename filter that accepts regular expressions like spm_select.
Hope this helps,
Jan
Chris Bishop wrote:
> Hello group,
>
> I just started writing our labs batch scripts for SPM5 and I'm having a
> problem (user related, I'm sure) with spm_select. I'm trying to get the
> full path names for EPI files like with spm_get in SPM2. Using
> P=spm_get, P would have a list of files like '/some/path/file_name', but
> P=spm_select('List',...) only gives me 'file_name'. How can I get the
> absolute paths of these files using spm_select?
>
> Cheers,
> -Chris
>
--
Jan Gläscher, Ph.D. Div. Humanities & Social Sciences
+1 (626) 395-3898 (office) Caltech, Broad Center, M/C 114-96
+1 (626) 395-2000 (fax) 1200 California Blvd
[log in to unmask] Pasadena, CA 91125
function files = spm_lselect(dir,filt)
%
% usage: spm_lselect(dir,filt)
%
% wrapper script for spm_select('list',...) which
% returns the full path names, ...
%
% because the original spm_select('list'...) only returns
% the filenames (without paths). How annoying!
%
files = spm_select('list',dir,filt);
dirs = repmat([spm_select('cpath',dir)],size(files,1),1);
files = strcat(dirs,filesep,deblank(files));
|