Introduction to SPM Batching

Slides:



Advertisements
Similar presentations
TortoiseSVN By Group 1 Team B. Installing TortoiseSVN.
Advertisements

SPM5 Tutorials by the Wellcome Department of Imaging Neuroscience
The General Linear Model (GLM)
SPM – introduction & orientation introduction to the SPM software and resources introduction to the SPM software and resources.
Statistical Inference
Overview of SPM p <0.05 Statistical parametric map (SPM)
The General Linear Model Christophe Phillips Cyclotron Research Centre University of Liège, Belgium SPM Short Course London, May 2011.
SPM Course Zurich, February 2012 Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London.
SPM 2002 Experimental Design Daniel Glaser Institute of Cognitive Neuroscience, UCL Slides from: Rik Henson, Christian Buchel, Karl Friston, Chris Frith,
Buttons in SPM5 Carolyn McGettigan & Alice Grogan Methods for Dummies 5 th April 2006.
Buttons in SPM5 Seán O’Sullivan, ION Alice Jones, Dept of Psychology Alice Jones, Dept of Psychology Methods for Dummies 16 th Jan 2008.
SPM Software & Resources Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2011.
SPM Software & Resources Wellcome Trust Centre for Neuroimaging University College London SPM Course London, October 2008.
SPM for EEG/MEG Guillaume Flandin
Event-related fMRI (er-fMRI)
Wellcome Centre for Neuroimaging at UCL
Group Analyses Guillaume Flandin SPM Course Zurich, February 2014
Group analysis Kherif Ferath Wellcome Trust Centre for Neuroimaging University College London SPM Course London, Oct 2010.
1st level analysis: basis functions, parametric modulation and correlated regressors. 1 st of February 2012 Sylvia Kreutzer Max-Philipp Stenner Methods.
Experimental design of fMRI studies SPM Course 2014 Sandra Iglesias Translational Neuromodeling Unit University of Zurich & ETH Zurich With many thanks.
Experimental design of fMRI studies Methods & models for fMRI data analysis in neuroeconomics April 2010 Klaas Enno Stephan Laboratory for Social and Neural.
Bayesian models for fMRI data
Gordon Wright & Marie de Guzman 15 December 2010 Co-registration & Spatial Normalisation.
Experimental design of fMRI studies SPM Course 2012 Sandra Iglesias Translational Neuromodeling Unit University of Zurich & ETH Zurich With many thanks.
Institute for Biomedical Engineering (ETH Zurich)‏ and Empirical Research in Economics (Univ. of Zurich)‏ Z URICH.
JOAQUÍN NAVAJAS SARAH BUCK 2014 fMRI data pre-processing Methods for Dummies Realigning and unwarping.
Multiple comparison correction Methods & models for fMRI data analysis 29 October 2008 Klaas Enno Stephan Branco Weiss Laboratory (BWL) Institute for Empirical.
Introduction to SPM SPM fMRI Course London, May 2012 Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London.
1 Hands-On Data Analysis Kate Pirog Revill and Chris Rorden Data from safety training –9 subjects –Finger-tapping task (12s tapping, 12s rest) –188 scans.
The other stuff Vladimir Litvak Wellcome Trust Centre for Neuroimaging UCL Institute of Neurology, London, UK.
Subversion (SVN) Tutorial Source:
SPM Course Zurich, February 2015 Group Analyses Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London With many thanks to.
Coregistration and Spatial Normalisation
Version Control Menggunakan TortoiseSVN
Subversion (SVN) A Revision Control System Successor to CVS Carlos Armas Hervey Allen.
SENG 403 Tutorial 1 1SENG 403 – Winter Agenda Version Control Basics Subversion Basic actions in Subversion Some examples 2SENG 403 – Winter 2012.
Introduction to SPM Batching Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London MATLAB for Cognitive Neuroscience ICN,
fMRI Preprocessing & Noise Modeling
Bayesian Inference and Posterior Probability Maps Guillaume Flandin Wellcome Department of Imaging Neuroscience, University College London, UK SPM Course,
Institute for Biomedical Engineering (ETH Zurich)‏ & Computational Neuroeconomics Group (Univ. of Zurich)
Methods for Dummies Overview and Introduction
SPM Software & Resources Wellcome Trust Centre for Neuroimaging University College London SPM Course London, October 2008.
SPM Software & Resources Wellcome Trust Centre for Neuroimaging University College London SPM Course London, October 2009.
The General Linear Model
The General Linear Model Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM fMRI Course London, May 2012.
SPM – introduction & orientation introduction to the SPM software and resources introduction to the SPM software and resources.
Multimodal Brain Imaging Wellcome Trust Centre for Neuroimaging, University College, London Guillaume Flandin, CEA, Paris Nelson Trujillo-Barreto, CNC,
SPM Resources. SPM8 > Matlab 7.1 SPMSPM –MatLab functions & scripts basic “toolbox” functions macro functions/scripts GUI functions & i/o primitives basic.
Bayesian Methods Will Penny and Guillaume Flandin Wellcome Department of Imaging Neuroscience, University College London, UK SPM Course, London, May 12.
1 st Level Analysis Design Matrix, Contrasts and Inference, GLM Hassan Hawsawi and Lena Holderer 09 December 2015.
Mixture Models with Adaptive Spatial Priors Will Penny Karl Friston Acknowledgments: Stefan Kiebel and John Ashburner The Wellcome Department of Imaging.
Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course Zurich, February 2008 Bayesian Inference.
Aa Scripting SPM analyses using aa Rhodri Cusack.
The General Linear Model Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM fMRI Course London, October 2012.
Group Analyses Guillaume Flandin SPM Course London, October 2016
Statistical Parametric Mapping for fMRI / MRI / VBM
SPM Software & Resources
The General Linear Model
Wellcome Trust Centre for Neuroimaging University College London
Keith Worsley Keith Worsley
The General Linear Model
From buttons to code Eamonn Walsh & Domenica Bueti
The General Linear Model
Statistical Parametric Mapping
Wellcome Centre for Neuroimaging at UCL
Bayesian Inference in SPM2
The General Linear Model
Mixture Models with Adaptive Spatial Priors
The General Linear Model
The General Linear Model
Presentation transcript:

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

Statistical Inference Image time-series Spatial filter Design matrix Statistical Parametric Map Realignment Smoothing General Linear Model Statistical Inference RFT Normalisation p <0.05 Anatomical reference Parameter estimates

Installing SPM using SVN FIL & ICN only SPM repository your SPM working copy SPM Install Subversion: http://subversion.tigris.org/ http://tortoisesvn.net/ on Windows Online instructions: http://www.fil.ion.ucl.ac.uk/spm/local/svn/ http://www.fil.ion.ucl.ac.uk/spm/local/tbr/ 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 Import_Archive: svn://bread.fil.ion.ucl.ac.uk/tools/Import_Archive

TortoiseSVN: Checkout

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

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

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/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. SPM5 Job Manager: “jobs” structure. Virtual files. SPM8 Batch Editor: “matlabbatch” structure. Dependencies.

SPM “jobs” Batch mode: (“matlabbatch” for SPM8) 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.

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

Data organisation Should be as generic as possible to ease batch script writing.

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

Workflow for SPM8 Batch Editor Subject directory Subject directory Functional data Functional data Structural data Structural data Experimental design Experimental design Change directory Realignment Coregistration Segmentation Normalisation Normalisation Smoothing Make directory Model Specification 1. Subject-independent data/analysis steps 2. Data flow (dependencies) Model Estimation 3. Subject-specific data

For more information… SPM5/8 script examples: http://www.fil.ion.ucl.ac.uk/spm/data/ SPM8 manual chapter 34: http://www.fil.ion.ucl.ac.uk/spm/doc/spm8_manual.pdf L. Kasper’s slides for SPM8: http://www.fil.ion.ucl.ac.uk/spm/course/slides09-zurich/