%   BAT.m

%   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. 

%---------------------------------------------------------------
% user variables defined here 
%---------------------------------------------------------------
global SubVec MaskStr
SubVec=[1:10]
                                                                     
MaskStr='snra'

%---------------------------------------------------------------
% batch variables defined here for analyses
%---------------------------------------------------------------

analyses = struct( ... 
   'type', 			[1 2], ...
   'index', 		[1 1], ...
   'work_dir', 	[8 8], ...
   'mfile', 		[1 1]);
%-------------------------------------------

type = {'model','contrasts','defaults_edit','headers',...
	'means','realign','normalisation','smooth'};

%-------------------------------------------
WdP=['E:\fMRIData\fMRIDataGV\'];

Wd1=[MaskStr,'SLoHi'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd1);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd1,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd1,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd2=[MaskStr,'SPara'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd2);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd2,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd2,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd3=[MaskStr,'SLoHi09'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd3);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd3,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd3,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd4=[MaskStr,'SLoHi18'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd4);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd4,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd4,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd5=[MaskStr,'SLoHi36'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd5);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd5,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd5,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd6=[MaskStr,'SLoHi72'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd6);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd6,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd6,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd7=[MaskStr,'SLoOff'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd7);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd7,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd7,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end
Wd8=[MaskStr,'SHiOff'];
[MkDirStatus,MkDirMsg]=mkdir(WdP,Wd8);
if MkDirStatus==1;
	fprintf(['Make directory: ',Wd8,' !\n\n'])
elseif MkDirStatus==2;
	fprintf(['Directory: ',Wd8,' allready exists !\n\n'])
elseif MkDirStatus==0;
	MkDirStatus=MkDirStatus
	MkDirMsg=MkDirMsg
	return;
end

Wd1=[WdP,FileSep,Wd1]
Wd2=[WdP,FileSep,Wd2]
Wd3=[WdP,FileSep,Wd3]
Wd4=[WdP,FileSep,Wd4]
Wd5=[WdP,FileSep,Wd5]
Wd6=[WdP,FileSep,Wd6]
Wd7=[WdP,FileSep,Wd7]
Wd8=[WdP,FileSep,Wd8]


work_dir = {Wd1,Wd2,Wd3,Wd4,Wd5,Wd6,Wd7,Wd8};

%-------------------------------------------
m1=['E:\MATLAB\toolbox\fMRI\BatchModelT']
mfile={m1};

%-------------------------------------------

