Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to SPM Batching Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London MATLAB for Cognitive Neuroscience ICN,

Similar presentations


Presentation on theme: "Introduction to SPM Batching Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London MATLAB for Cognitive Neuroscience ICN,"— Presentation transcript:

1 Introduction to SPM Batching Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London MATLAB for Cognitive Neuroscience ICN, May 2008 from acquisition to publication…

2 Installing SPM using SVN  Install Subversion:  http://subversion.tigris.org/ http://subversion.tigris.org/  http://tortoisesvn.net/ http://tortoisesvn.net/ SPM repository your SPM working copy SPM Repository URLs: SPM5: svn://bread.fil.ion.ucl.ac.uk/spm/branches/spm5 SPM8: svn://bread.fil.ion.ucl.ac.uk/spm/trunk TBR: svn://bread.fil.ion.ucl.ac.uk/tools/TBR/trunk  Online instructions:  http://www.fil.ion.ucl.ac.uk/spm/local/svn/ http://www.fil.ion.ucl.ac.uk/spm/local/svn/  http://www.fil.ion.ucl.ac.uk/spm/local/tbr/ http://www.fil.ion.ucl.ac.uk/spm/local/tbr/ FIL & ICN only

3 TortoiseSVN: Checkout

4 TortoiseSVN: Update Case 1: your SPM files needed to be updated. Case 2: your SPM files are up-to-date.

5 MATLAB path Add Folder (and not with Subfolders) Remove older SPM versions from the path

6 Batching SPM{2,5,8}  SPM Extensions webpage: http://www.fil.ion.ucl.ac.uk/spm/ext/#batch_utils SPM99, SPM2 [1] http://en.wikibooks.org/wiki/SPM-Example_batch_script [2] http://imaging.mrc-cbu.cam.ac.uk/imaging/SpmBatch5http://en.wikibooks.org/wiki/SPM-Example_batch_scripthttp://imaging.mrc-cbu.cam.ac.uk/imaging/SpmBatch5  Call SPM functions directly [1,2] :  spm_realign  spm_slice_timing  spm_normalise  spm_write_sn  spm_smooth  spm_fmri_spm_ui  spm_spm  spm_FcUtil  spm_contrasts  Requires knowledge about input/output arguments of main SPM functions and about the SPM.mat structure. SPM8  Batch Editor:  “matlabbatch” structure.  Dependencies. SPM5  Job Manager:  “jobs” structure.  Virtual files.

7 SPM “jobs”  Goal: create a.mat file containing a Matlab structure ‘jobs’ similar to the one created using the GUI.  Tip: you only need to specify parameters that you would enter in the interface, the others will be automatically imported when executed.  The jobs structure will mimic the interface.  Batch mode:

8 Useful functions:  Select files: spm_select.m: [files,dirs] = spm_select(‘FPList',direc,filt) ex.: f = spm_select(‘FPList',‘C:\data\exp’,‘^fM.*\.img$’);  Job manager: spm_jobman.m: spm_jobman(‘run’,jobs); % execute a job spm_jobman(‘interactive’,jobs); % display a job in the GUI % jobs can also be a.mat filename  Overall structure of a batch script: spm(‘defaults’,‘fmri’); clear jobs % fill in jobs structure save(‘My_Batch.mat’,‘jobs’); spm_jobman(‘run’,jobs); See also:  fullfile  cellstr  kron  editfilenames*

9 Data organisation  Should be as generic as possible to ease batch script writing. Experiment subject1 structural functional session1 session2 … jobs stats model1 model2 … subject2 … scripts rfxmodel condition1 condition2 … Postscript (.ps) file: PDFCreator (http://www.pdfforge.org/)http://www.pdfforge.org/

10 A potention pipeline for preprocessing with SPM: RealignSegment Coregister Smooth Normalize: Write Raw functional images Update *.hdr mean.{img,hdr} rp_*.txt m*/c1*/c2*.{img,hdr} *_seg_sn.mat *_seg_inv_sn.mat Update *.hdr wm*. {img,hdr} sw*.{img,hdr} Anatomical image … Normalize: Write w*.{img,hdr} Group mean


Download ppt "Introduction to SPM Batching Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London MATLAB for Cognitive Neuroscience ICN,"

Similar presentations


Ads by Google