<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>FreesurferGoodies/copyFiles</title><revhistory><revision><revnumber>4</revnumber><date>2013-06-25 11:00:18</date><authorinitials>IanCharest</authorinitials></revision><revision><revnumber>3</revnumber><date>2013-06-25 10:59:55</date><authorinitials>IanCharest</authorinitials></revision><revision><revnumber>2</revnumber><date>2013-06-25 10:56:51</date><authorinitials>IanCharest</authorinitials></revision><revision><revnumber>1</revnumber><date>2013-06-25 10:56:33</date><authorinitials>IanCharest</authorinitials></revision></revhistory></articleinfo><screen><![CDATA[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',...
    };
]]><![CDATA[
nSubjects=length(subjects);
]]><![CDATA[
for subI=1:nSubjects
    % where will the stat-maps be?
    thisSubject.spm_maps = fullfile(freesurferPath,subjects{subI},'spm_maps');
]]><![CDATA[
]]><![CDATA[
    % where are the spm (native) space maps?
    thisSubject.stats = fullfile(mridataPath,subjects{subI},'thestatsmaps');
]]><![CDATA[
    thisSubject.structural = fullfile(mridataPath,subjects{subI},'structurals');
]]><![CDATA[
    try
        mkdir(thisSubject.spm_maps)
    end
]]><![CDATA[
    % 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]]></screen></article>