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



%Changes in (search for BATCHMJ):
%spm_spm_ui
%spm_result_ui
%spm_getSPM
                                                                     
%spm_conman
%spm_render
%spm_input_ui

for Ind=1:3%4
    if Ind==1
        SubgroupDir='All' 
        StatsDesign=['One sample t-test'];
    elseif Ind==2
        SubgroupDir='Female' 
        StatsDesign=['One sample t-test'];
    elseif Ind==3
        SubgroupDir='Male' 
        StatsDesign=['One sample t-test'];
    elseif Ind==4
        SubgroupDir='Gender' 
        StatsDesign=['Two sample t-test'];
    end
    FemaleVec=[7 9 10 11 13 14 16 17 18 20 22]
    MaleVec  =[2 3 4  5  6  12 15 21 23 24 25]
    if strcmp(SubgroupDir,'All') | strcmp(SubgroupDir,'Gender')
        SubVec=[MaleVec,FemaleVec]
    elseif strcmp(SubgroupDir,'Female')
        SubVec=FemaleVec
    elseif strcmp(SubgroupDir,'Male')
        SubVec=MaleVec
    end
    
    IndVec1=MaleVec
    NIndVec1=length(IndVec1)
    IndVec2=FemaleVec
    NIndVec2=length(IndVec2)
    IndVec=[ones(size(IndVec1)),2.*ones(size(IndVec2))]
    
    ConStart=123;
    ConEnd=128;
    Batch2ndLevel(ConStart,ConEnd,SubVec,SubgroupDir,StatsDesign)
    BatchResults(ConStart,ConEnd,SubVec,SubgroupDir)
end