function copyFilesFromSPMfoldertoFreesurferFolder mridataPath='/the/path/to/your/projectfolder/where/the/mri/preprocessed/data/is'; freesurferPath='/the/path/to/your/projectfolder/where/the/freesurfer/preprocessed/data/is'; subjects = {... 'CBUXXXYYY',... 'CBUXXXYY2',... }; nSubjects=length(subjects); for subI=1:nSubjects % where will the stat-maps be? thisSubject.spm_maps = fullfile(freesurferPath,subjects{subI},'spm_maps'); % where are the spm (native) space maps? thisSubject.stats = fullfile(mridataPath,subjects{subI},'thestatsmaps'); thisSubject.structural = fullfile(mridataPath,subjects{subI},'structurals'); try mkdir(thisSubject.spm_maps) end % first copy the spm_maps cd(thisSubject.stats) thisSource=fullfile(thisSubject.stats,'*spmT*'); thisDestination=thisSubject.spm_maps; copyfile(thisSource,thisDestination); % second copy the structural cd(thisSubject.structural) thisSource=fullfile(thisSubject.structural,'s*.nii'); copyfile(thisSource,thisDestination); end