%   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. global SubInd SubIndStr Base BaseStr MaskStr




%---------------------------------------------------------------
% model(1) Low-Off vs High Off
%---------------------------------------------------------------
                                                                     
clear F1 F2 
Mask=[MaskStr,'*.img']
FolderName=['F:\ValAro\',SubIndStr,'\09\']
F1=spm_get('Files',FolderName,Mask);
ValAro09RealignFile=spm_get('Files',FolderName,['realignment*.*'])
ValAro09RealignMat=ReadTxtMat(ValAro09RealignFile,[6 406]);
ValAro09RealignMat=ValAro09RealignMat';
if size(ValAro09RealignMat)~=[406,6]
   error('size(ValAro09RealignMat)~=[406,6]')
end
FolderName=['F:\ValAro\',SubIndStr,'\36\'];
F2=spm_get('Files',FolderName,Mask);
ValAro36RealignFile=spm_get('Files',FolderName,['realignment*.*'])
ValAro36RealignMat=ReadTxtMat(ValAro36RealignFile,[6 406]);
ValAro36RealignMat=ValAro36RealignMat';
if size(ValAro36RealignMat)~=[406,6]
   error('size(ValAro36RealignMat)~=[406,6]')
end
F1
F2
if SubInd==21 | SubInd==23 | SubInd==24  
   F1Tmp=F2;
   F2=F1;
   F1=F1Tmp;
   ValAro36RealignMatTmp=ValAro36RealignMat;
   ValAro09RealignMat=ValAro36RealignMat;
   ValAro36RealignMat=ValAro36RealignMatTmp;
   clear F1Tmp ValAro36RealignMatTmp
   F1
   F2
end

%---------------------------------------------------------------
% batch variables defined here for analysis 'model'
%---------------------------------------------------------------

model(1) = struct( ...
 'types',          3);
 

contrasts(1) = struct( ...
  'names',  {{'Test'}}, ...
  'types',   {{'T'}}, ...
  'values',  {{1}} ...
);