%% subject loop
function decode = claculateMultiSubjectDecodePerformance(timelineParams,calculateParams,paramModel)

decode = struct;
decode.decodePerformance = [];
decode.rawTimeCourse     = [];

for subjectCell = calculateParams.subjectSelection
    SubjectID = cell2mat(subjectCell);
    namehelper = strcat('s',SubjectID); %Vars can not start with numbers.

    display('loading SPM.mat ...');
    spm = load(fullfile(calculateParams.PROJECT_BASE_PATH,SubjectID,calculateParams.PROJECT_RESULT_PATH));
    display('... done.');

    % per subject params..
    subjectParams = struct;
    
    subjectParams.des             = spm.SPM;


    subjectParams.voxelList       = mapVoxelList(voxelList,SubjectID);

    
    subjectParams.SubjectID       = SubjectID;
    subjectParams.namehelper      = namehelper;
%     assignin('base','calculateParams',calculateParams);

    display(sprintf('calculating cross-validation performance time-shift for Subject %s. Please Wait. ...',SubjectID));
    display('switching off all warnings');
    warning_state               = warning('off','all');
    display('calculating ...');
    decode.(namehelper)         = calculateDecodePerformance(timelineParams,calculateParams,subjectParams);

    display('... done');
    display('restoring warnings');
    warning(warning_state);

    decode.decodePerformance    = [decode.decodePerformance decode.(namehelper).decodePerformance];
    decode.rawTimeCourse        = [decode.rawTimeCourse decode.(namehelper).rawTimeCourse];

    assignin('base','decode',decode);
end

end