function fileList = getImageFileList(subjectdir,sessionlist,mask)fileList = [];switch getSPMVersioncase 'SPM5'for session = sessionlist;[sessionFileList dd] = spm_select('FPList',fullfile(subjectdir,getSessionDirName(session)),mask);fileList = [fileList; sessionFileList];endotherwisefor session = sessionlist;sessiondir = fullfile(subjectdir,getSessionDirName(session));fileList = strvcat(fileList, getFilteredFileList(sessiondir,mask,1));endend% fileListend