function SliceTime(SubInd,NSlices);
%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.                                                                      



if nargin<2;NSlices=[];end

if nargin<1;SubInd=[];end



if isempty(SubInd); return; end

if isempty(NSlices); 

   NSlices=20;

   TR=3;

end



SubIndStr=int2str(SubInd);

if SubInd<10

   SubIndStr=['0',SubIndStr];

end

MaskStr=SubIndStr

FolderName=['F:\ValAro\96\0003']

Mask=['*.img']

P=spm_get('Files',FolderName,Mask)



SliceVec=zeros(1,NSlices);

SliceVec(1:NSlices/2)=[2:2:NSlices]';

SliceVec(NSlices/2+1:NSlices)=[1:2:NSlices]';

SliceVec=SliceVec

refslice=1

SubIndStr=SubIndStr

Seq=[];

spm_slice_timing(P,Seq,refslice,[(TR-1)/(NSlices-1),1],SliceVec);

 



FolderName=['F:\ValAro\96\0409']

Mask=['*.img'];

P=spm_get('Files',FolderName,Mask)

spm_slice_timing(P,Seq,refslice,[(TR-1)/(NSlices-1),1],SliceVec);



return; 