Print

Print


Pieter, Jan, Ged, and others,
thanks for your help, I'll try and test your solutions to fix this 
problem...
Best regards
Jerome

Jan Gläscher a écrit :
> Pieter, Jerome, Ged, and others,
>
> the trouble with spm_select('list',dir,filt) is that it only returns 
> the filename without the full path. So, this is kind of useless when 
> scripting analyses in a batch file. So far, I haven't figured out a 
> way of how to tell spm_select (in its non-interactive 'list' mode) 
> that I want the full path prepended to the filename. If anyone has, 
> I'd be more than interested in it.
>
> Until then, I use a wrapper script to prepend the path information:
>
> function files = spm_lselect(dir,filt);
>
> files = spm_select('list',dir,filt);
> dirs = repmat([spm_select('cpath',dir)],size(files,1),1);
> files = strcat(dirs,filesep,files);
>
>
> Cheers,
> Jan
>
>
> Pieter Vandemaele wrote:
>> Sorry, I my mistake.
>> I do it the following way:
>>
>> filt = ['^', '', '.*\.img'];
>> P = spm_select('List', yourdirectory, filt) ;
>>
>> Regards
>>
>> Pieter
>>
>>
>> Jérôme Redouté schreef:
>>> Thanks Pieter,
>>> But it is exactly what I don't want to have to do.
>>> I want to have all these files selected automatically, because if I 
>>> use this function in a loop in order to select files from several 
>>> sessions/subjects, it is not really usefull if I need to select 
>>> manually...
>>> Thanks again
>>> Jerome
>>>
>>>
>>> Pieter Vandemaele a écrit :
>>>> Hi Jêrome,
>>>>
>>>> If you click the right mouse button, you can get a context menu 
>>>> where you can click "Select all". Of course, you first have to 
>>>> enter the right filter. For more information, you should read the 
>>>> comments in spm_select.m.
>>>> Good luck
>>>>
>>>> Pieter
>>>>
>>>> Pieter Vandemaele
>>>> MSc-Ing
>>>> Ghent Institute for Functional and Metabolic Imaging
>>>>
>>>>
>>>> Jérôme Redouté schreef:
>>>>> Dear SPMers,
>>>>> I try to write a short script where I need to select volumes from 
>>>>> a 4D Niftii file.
>>>>> If I use the spm_select function with these parameters:
>>>>> spm_select([1 Inf], 'image', 'msg', '' ,'c:\MyfMRIData\','filter', 
>>>>> '[1:400]' )
>>>>> I get a prompt window asking me to select manually all the 400 
>>>>> files that are correctly displayed in and then press Done.
>>>>> My question is: Is there a mean skip this interactive mode and 
>>>>> select automatically all these files, as the 'select all' function 
>>>>> do?
>>>>> I did not meet this problem with the previous spm_get function
>>>>> Thanks for your help
>>>>> Jerome
>>>>>
>>>>
>>
>

-- 
---------------------------------
Jerome Redouté, Ph. D.
Centre de Neuroscience Cognitive
CNRS-UMR 5229
67, Bd. Pinel. 69675 Bron
Tel: 04 37 91 12 44
[log in to unmask]
---------------------------------