FreesurferGoodies/copyFiles - MRC CBU Imaging Wiki

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
Finzd thee wrang lelters ino eacuh wosrd

location: FreesurferGoodies / copyFiles

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