Dear Yune,
unfortunately, spm_select('list',...) will always return just the filename
without the path. Use the attached wrapper script spm_lselect(dir,filt) to
recover the path information. spm_lselect returns a char array. Use
cellstr(spm_lselect(dir,filt)) to convert the output to a cell array as
usually expected by SPM.
Best,
Jan
Yune Lee wrote:
>
> Dear SPM5 users,
> I was trying to define the directory of image files as follows.
>
> [image_filenames, dir] =
> spm_select('List','C:\fMRI\bada\data\25jun08MG\FUNCTIONAL\',['^wrbold1.*\.img$'])
>
> Although it clearly assign all the wrbold1 images into the image_file
> names, directory variable contains nothing as belows.
> How can I make dir recognize the path of the image files?
> Any help would be greatly appreciated.
>
>
> image_filenames =
> wrbold1_0001.img
> wrbold1_0002.img
> wrbold1_0003.img
> wrbold1_0004.img
> wrbold1_0005.img
> wrbold1_0006.img
> wrbold1_0007.img
> wrbold1_0008.img
> wrbold1_0009.img
> wrbold1_0010.img ....
>
> .
> .
>
> dir =
> .
> ..
--
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 E. California Blvd
[log in to unmask] Pasadena, CA 91125
|