240 likes | 442 Views
fMRI Single Subject Analysis & Batch Programming. Lars Kasper. Overview. Quality Assessment of Raw Data Spatial Preprocessing Realign and Unwarp Coregister General Linear Model: The Design Matrix Estimating the Model Results: Defining and Analyzing Contrasts
E N D
fMRI Single Subject Analysis & Batch Programming Lars Kasper
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Overview • Quality Assessment of Raw Data • Spatial Preprocessing • Realign and Unwarp • Coregister • General Linear Model: The Design Matrix • Estimating the Model • Results: Defining and Analyzing Contrasts • Reporting and Summarizing • Outlook: What to do with a lot of single subject results
Overview of SPM Statistical parametric map (SPM) Design matrix Image time-series Kernel Realignment Smoothing General linear model Gaussian field theory Statistical inference Normalisation p <0.05 Template Parameter estimates
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Goals of this tutorial After finishingthissession, youshouldbeableto AnalyzesinglesubjectfMRIdatasetsusing • theGraphical User Interface (GUI) of SPM • The Batch Editor of SPM • A templateMatlab .m-filetobatchveryflexibly 2 3 1
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Batch processing of data • Repeats same dataanalysisformanysubjects (>=2) • Not proneto human errors, reproduciblewhat was done • e. g. jobsmat-files • Runs automatically, nosupervisionneeded • Researcher canconcentrate on assessingtheresults • CAVEAT: Temptingtoforgetabout all analysissteps in betweenwhichcouldleadtoerrors in yourconclusions • Therefore: Alwaysmakesure, thatmeaningfulresultswerecreatedateachstep • Using Display/CheckRegtoviewrawdata, preprocesseddata • Usingspm_printto save reportedsupplementarydataoutput • Ifanythingwentwrong, usedebugging
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Introducing the Dataset • Rik Henson‘s famous vs non-famous faces dataset http://www.fil.ion.ucl.ac.uk/spm/data/face_rep/face_rep_SPM5.html • Includes a manual with step-by-step instruction for analysis (homework ;-)) • Download from SPM homepage (available for SPM5, but works fine with SPM8b)
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Introducing the Dataset • Factorial 2 x 2 design to investigate repetition suppression • Question: Influence of repeated stimulus presentation on brain activity (accomodation of response)? • Each stimulus (pictures of faces) presented twice during a session • Condition Rep, Level: 1 or 2 • lag between presentations randomized • 26 Famous and 26 non-famous faces to differentiate between familiarity (long-term memory) and repetition • Condition Fam, Level F(amous) and N(onfamous) • Task: Decision whether famous or nonfamous (button-press)
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Introducing the Dataset: Published Results • Right Fusiform face area • Repetition suppression for familiar/famous faces • Left Occipital face area (posterior, occip. extrastriate) • Repetition suppression for familiar AND unfamiliar faces • Posterior cingulate and bilateral parietal cortex • Repetition enhancement
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Overview • Quality AssessmentofRaw Data • SpatialPreprocessing • RealignandUnwarp • Coregister • General Linear Model: The Design Matrix • Estimatingthe Model • Results: DefiningandAnalyzingContrasts • Reporting andSummarizing • Outlook: Whatto do with a lotofsinglesubjectresults
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Overview • Quality AssessmentofRaw Data • SpatialPreprocessing • RealignandUnwarp • Coregister • General Linear Model: The Design Matrix • Estimatingthe Model • Results: DefiningandAnalyzingContrasts • Reporting andSummarizing • Outlook: Whatto do with a lotofsinglesubjectresults
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Spatial Preprocessing – Realign • sd Batch Editor Batch File GUI FORMAT P = spm_realign (P,flags)
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Spatial Preprocessing – Unwarp Batch Editor Batch File GUI uw_params= spm_uw_estimate (P,uw_est_flags); spm_uw_apply (uw_params,uw_write_flags);
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Uh…this takes ages… • Now you can probably value the benefits of batch processing. If you are still keen on doing all that by hand (good exercise!), refer to the following • The SPM manual • Most current version in your spm8b-folder, sub-folder man/manual.pdf • Rik Henson‘s famous vs non-famous faces dataset http://www.fil.ion.ucl.ac.uk/spm/data/face_rep/face_rep_SPM5.html • Included in SPM manual, chapter 29, with step-by-step instruction for analysis • Available for SPM5, but works fine with SPM8b
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Overview • Quality AssessmentofRaw Data • SpatialPreprocessing • RealignandUnwarp • Coregister • General Linear Model: The Design Matrix • Estimatingthe Model • Results: DefiningandAnalyzingContrasts • Reporting andSummarizing • Outlook: Whatto do with a lotofsinglesubjectresults
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Overview • Quality AssessmentofRaw Data • SpatialPreprocessing • RealignandUnwarp • Coregister • General Linear Model: The Design Matrix • Estimatingthe Model • Results: DefiningandAnalyzingContrasts • Reporting andSummarizing • Outlook: Whatto do with a lotofsinglesubjectresults
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) General Workflow for the batch interface Top-down approach • Specify subject-independent data/analysis steps • Specify subject-independent file-dependencies (data flow) • Specify subject-related data (e.g. event-timing) 3 1 2
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) 1. The subject-independent analysis parts • Load all modules first (in right order!) • Then specify details (where Xs are found) which are subject independent • TR • Nslices • model factors • contrasts of interest
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) 2. Data-flow specification (subject-independent dependencies) • Specify, which results of which steps are input to another step (DEP-sign) • e.g. smoothed images needed for model spec • Afterwards save this job as template .mat file
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) 3. Add subject-dependent data/information • Essentially go to all X‘s and fill in appropriate values • e.g. the .mat-file of the conditions onsets/durations • Save this job as subject-batch file & Run
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) 4. Making it multi-subject 1 • Make sure, parameters to be adjusted have an X (clear value) for the single subject template • Specify a meta-job with Run batch • Create one run for every subject and add missing parameter values (in right order) 3 2
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Resources and Useful Literature • All step-by-step instructions can be found in the SPM manual, chapter 35 • Also multiple-session and multiple subjects processing included • Batch templates are in your spm path: • Configured subject-independent analysis steps <spm8b>/man/batch/face_single_subject_template_nodeps.m • With dependencies included <spm8b>/man/batch/face_single_subject_template.m • With multiple subjects <spm8b>/man/batch/face_multi_subject_template.m
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Many, many thanks to • Klaas Enno Stephan • The SPM developers (FIL methods group)
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Extending the batchfile with SPM GUI functions • Debugging • Generally a good idea to find out, how things work in SPM • Crucial for batch-programming using a .m-file • Here: debug spm.m by setting a breakpoint • If called function found, use edit <functionname>.m to look at the %comments in the file
Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT) Tuning the engine – Matlab workspace variables • e.g. to manipulate SPM.mat or jobs by hand • also important during debugging, how variables are defined and changed