function dop=dopDataCalc(dop)
% dopOSCCI Mark II: dopDataCalc~ 28-10-2010 (last edit)
%
% calculate data summaries...
%
% Includes:
% - dopDataIndexCalcSetup
% - dopDataLIcalcSetup
% - dopDataSplitHalfCalcSetup
%

try
if ~dop.sum.skip && ~dop.sum.quit
    %% selected range descriptives
    % base, poi, epoch
    %     dop=dopDataIndices(dop.stack);
    dop.ind=dopDataIndexCalcSetup(dop.stack,dop.filter,...
            'screen',dop.scrn,'sampleRate',dop.def.downHertz,...
            'evType',dop.def.evType,'evMatch',dop.def.evMatch,...
            'saveEpoch',dop.def.saveEpoch);
    %% dropout
    dop.drop=dopDataDropCalcSetup(dop.raw.stack,dop.filter,...
        'screen',dop.scrn,'sampleRate',dop.def.downHertz,...
            'evType',dop.def.evType,'evMatch',dop.def.evMatch,...
            'saveEpoch',dop.def.saveEpoch);
        
    %% laterality indices
    dop.li=dopDataLIcalcSetup(dop.stack,dop.filter,'actWin',dop.def.actWin,...
        'screen',dop.scrn,'sampleRate',dop.def.downHertz,...
        'evType',dop.def.evType,'saveEpoch',dop.def.saveEpoch,...
        'epochGraph',sum(dop.def.graphs(:,4)));
    
    %% laterality indices
    dop.sph=dopDataSplitHalfCalcSetup(dop.stack,dop.filter,'actWin',dop.def.actWin,...
        'screen',dop.scrn,'sampleRate',dop.def.downHertz,...
        'evType',dop.def.evType,'saveEpoch',dop.def.saveEpoch,...
        'splitOptions',dop.def.splitOptions,'splitBal',dop.def.splitBal,...
        'splitCalcSave',dop.def.splitCalcSave,'splitLabels',dop.def.splitLabels);

end  
catch err
    %% catch dopOSCCI error
    % 
save(dopOSCCIdebug(mfilename));rethrow(err); 
%     dopOSCCIcrash(err,dop,mfilename);
end




