global SubVec

NSub=length(SubVec);
NSess=6;

realign = struct(...
'subject_nb', NSub, ...
'num_sessions',NSess, ...
'sessions', [1:NSub], ...
'option', 3, ...
'modality', 3, ...
'reslice_method', 2, ...
'create', 3, ...
'mask', 0, ...
'adjust_sampling_errors',0);

for SubInd=1:NSub;
   clear F1
   ActSub=SubVec(SubInd)
   ActSubStr=int2str(ActSub);
  	if ActSub<10
     	ActSubStr=['0',ActSubStr];
  	end
	for SessInd=1:NSess
   	ActSessStr=int2str(SessInd);
   	if SessInd<10
      	ActSessStr=['0',ActSessStr];
   	end
   	FolderName=['E:\fMRIData\fMRIDataGV\',ActSubStr,'\',ActSessStr,'\'];
   	Mask=['a',ActSubStr,'*.img'];
      Tmp=spm_get('Files',FolderName,Mask);
      F1{SessInd}=Tmp;
   end
   sessions(SubInd)=struct('images',{{F1{1:NSess}}});
end

