function dop=dopOSCCIsummary(dop)
% dopOSCCI Mark II: dopOSCCIsummary ~ 27-10-2010 (last edit)
%
% dopOSCCI's summary loop - once everything is set up, this starts the
% summary running.
%
dop.sum.count=0; % record of the file number being summarised
dop.sum.finish=0; % finish variable which controls the summary loop
dop.sum.quit=0; % quit variable to break the while summary loop
dop.sum.skip=0; % skip variable to skip and individual file, if e.g., no markers or suitable trials
dop.sum.totalFiles=length(dop.data.fileList);


while ~dop.sum.finish && ~dop.sum.quit && dop.sum.totalFiles %|| ...
    %             dop.test && dop.sum.count % just single file
    %% select file
    dop=dopSelectFile(dop);
    
    %% import & process data
    dop=dopGetData(dop);
    
    %% organise data
    % Includes:
    % - dopEventMarks (find the appropriate markers)
    % - dopEventStack (stack the data into events/trials)
    % - dopEventFilter (create filter for base and poi selection)
    % - dopEventActRej (creates epoch screen based upon activation
    %       rejection values, see dopTaskDef)
    % - dopEventBaseCorrect (runs baseline correction adjustment)
    % - dopEventDifference (calculates difference between the left and right
    %       doppler channels)
    % - dopEventAverage (calculates average activation of left & right
    %       channels)
    % - dopEventScreen (creates event/epoch screening array)
    
    dop=dopEventData(dop);
    
    %% screening
    dop=dopEpochScreen(dop);
    
    %% index filters
    dop=dopIndexFilters(dop);
    
    %% calculate summaries
    dop=dopDataCalc(dop);
    
    %% behavioural summary
    dop=dopBehSummary(dop);
    
    %% save data
    dop=dopSaveSum(dop); % save the summary data to file
    
    %% save graph data
    dop=dopGraphDataSave(dop);
    
    %% create graphs
    dop=dopGraph(dop);
    
    %% individual summary report
    dop=dopSumReport(dop);
    
    %% sessions
    dop=dopSessionCollect(dop);
    
end
% catch err
%     dopOSCCIcrash(err,dop,mfilename);
