% batch processing for the attention dataset (http://www.fil.ion.ucl.ac.uk/spm/data/attention/) % SPM preprocessing (normalisation of structural/functional volumes) spm_jobman('initcfg'); rootfolder=pwd; files=dir(fullfile(rootfolder,'functional','snffM00587_*.img')); if isempty(files), disp(['Download the data from (http://www.fil.ion.ucl.ac.uk/spm/data/attention/), cd to the downloaded ''attention'' folder and re-run this script']); return; end files=[repmat([fullfile(rootfolder,'functional'),filesep],[length(files),1]),strvcat(files(:).name)]; files=mat2cell(files,ones(size(files,1),1)); matlabbatch{1}.spm.spatial.normalise.estwrite.subj.source={fullfile(rootfolder,'structural','nsM00587_0002.img')}; matlabbatch{1}.spm.spatial.normalise.estwrite.subj.resample=files; matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.template={fullfile(fileparts(which('spm')),'templates','T1.nii')}; spm_jobman('run',matlabbatch); % CONN steps (see these scripts for details) conn_batchexample_attentiondataset_Setup; conn_batchexample_attentiondataset_Preprocessing; conn_batchexample_attentiondataset_Analyses; % launches conn gui to explore results conn conn('load',fullfile(pwd,'conn_attention.mat')); conn gui_results