Dear Marko,
Well spotted. A shortcut would be to use the 'FPlist' option of spm_select:
P = spm_select('FPlist','D:\face_rep\RawEPI','^swar.*\.img');
Best regards,
Guillaume.
On 11/12/16 11:54, Marko Wilke wrote:
> Hi,
>
> you may want to check the output (P) as I would guess it only contains
> the filenames, but not the paths to the individual images. This leads to
> the image not being found when called from other directories. If this is
> the problem, you could either do a
>
> cd('D:\face_rep\RawEPI')
>
> beforehand, or, arguably more elegantly, do
>
> mypath = 'D:\face_rep\RawEPI\';
> P = spm_select('list',mypath,'^swar.*\.img');
> P = [repmat(mypath, [size(P,1) 1]) P];
>
> or something along those lines (have no Matlab in front of me so can't
> check, but in principle it should work :)
>
> Cheers
> Marko
>
>
>
> --
> ____________________________________________________
> Prof. Dr. med. Marko Wilke
> Facharzt für Kinder- und Jugendmedizin
> Leiter, Experimentelle Pädiatrische Neurobildgebung
> Universitäts-Kinderklinik
> Abt. III (Neuropädiatrie)
>
> Marko Wilke, MD, PhD
> Pediatrician
> Head, Experimental Pediatric Neuroimaging
> University Children's Hospital
> Dept. III (Pediatric Neurology)
>
> Hoppe-Seyler-Str. 1
> D - 72076 Tübingen, Germany
> Tel. +49 7071 29-83416
> Fax +49 7071 29-5473
> [log in to unmask] <mailto:[log in to unmask]>
>
> http://www.medizin.uni-tuebingen.de/kinder/epn/
> ____________________________________________________
>
>>>> Boureghda Mohammed <[log in to unmask]> 12/10/16 10:20 PM >>>
> I am working with SPM12 to do ROI analysis:
>
> I loaded the image files of a single subject (preprocessed images files
> which contains the BOLD signals) via :
>
> P = spm_select('list','D:\face_rep\RawEPI','^swar.*\.img');
>
> Here I am dealing with the "Face fMRI data" from
> http://www.fil.ion.ucl.ac.uk/spm/data/face_rep/.
>
> When I ran spm_vol (P), the following error showed up in MATLAB command
> window
>
> ??? Error using ==> spm_vol>spm_vol_hdr at 80
> File "swarsM03953_0005_0006.img" does not exist.
>
> Error in ==> spm_vol at 61
> v = spm_vol_hdr(deblank(P(i,:)));
>
> is the order of the images files cause the problem? If yes, how can I
> fix it?
>
> Anyone has any suggestions?
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|