+ All Categories
Home > Documents > [email protected] [email protected] Institute for Biomedical Engineering (ETH Zurich) and...

[email protected] [email protected] Institute for Biomedical Engineering (ETH Zurich) and...

Date post: 18-Dec-2015
Category:
Upload: blanche-garrison
View: 214 times
Download: 1 times
Share this document with a friend
24
[email protected] [email protected] Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) ZURICH SPM COURSE 2009 fMRI Single Subject Analysis & Batch Programming Lars Kasper
Transcript
Page 1: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

[email protected]

[email protected]

Institute for

Biomedical Engineering (ETH Zurich)

and Empirical Research in Economics (Univ. of

Zurich)

ZURICH SPM COURSE 2009

fMRI Single Subject Analysis &

Batch ProgrammingLars Kasper

Page 2: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Overview

2Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

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

Page 3: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

RealignmentRealignment SmoothingSmoothing

NormalisationNormalisation

General linear modelGeneral linear model

Statistical parametric map Statistical parametric map (SPM)(SPM)Image time-seriesImage time-series

Parameter estimatesParameter estimates

Design matrixDesign matrix

TemplateTemplate

KernelKernel

Gaussian Gaussian field theoryfield theory

p <0.05p <0.05

StatisticalStatisticalinferenceinference

Overview of SPM

Page 4: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Goals of this tutorial

After finishing this session, you should be able to

Analyze single subject fMRI datasets using

1. the Graphical User Interface (GUI) of SPM

2. The Batch Editor of SPM

3. A template Matlab .m-file to batch very flexibly

4Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 5: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Batch processing of data

Repeats same data analysis for many subjects (>=2) Not prone to human errors, reproducible what was done

e. g. jobs mat-files

Runs automatically, no supervision needed Researcher can concentrate on assessing the results

CAVEAT: Tempting to forget about all analysis steps in between which could lead to errors in your conclusions

Therefore: Always make sure, that meaningful results were created at each step Using Display/CheckReg to view raw data, preprocessed data Using spm_print to save reported supplementary data output If anything went wrong, use debugging

5Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 6: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

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)

6Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 7: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

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)

7Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 8: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Introducing the Dataset: Published Resultsa. Right Fusiform face area

Repetition suppression for familiar/famous faces

b. Left Occipital face area (posterior, occip. extrastriate) Repetition suppression for familiar AND unfamiliar faces

c. Posterior cingulate and bilateral parietal cortex Repetition enhancement

8Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 9: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Overview

9Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

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

Page 10: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Overview

10Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

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

Page 11: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Spatial Preprocessing – Realign

sd

11Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

FORMAT P = spm_realign

(P,flags)

GUIGUI Batch EditorBatch Editor Batch FileBatch File

Page 12: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Spatial Preprocessing – Unwarp

12Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

uw_params=spm_uw_estimate(P,uw_est_flags);

spm_uw_apply(uw_params,uw_write_flags);

GUIGUI Batch EditorBatch Editor Batch FileBatch File

Page 13: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

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

13Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 14: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Overview

14Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

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

Page 15: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Overview

15Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

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

Page 16: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

General Workflow for the batch interface

16Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Top-down approach1. Specify subject-

independent data/analysis steps

2. Specify subject-independent file-dependencies (data flow)

3. Specify subject-related data (e.g. event-timing)

Page 17: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

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

17Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 18: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

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

18Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 19: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

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

19Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 20: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

4. Making it multi-subject

1. Make sure, parameters to be adjusted have an X (clear value) for the single subject template

2. Specify a meta-job with Run batch3. Create one run for every subject and add

missing parameter values (in right order)20Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann,

IBT)Lars Kasper (11-Feb-09)

Page 21: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

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

21Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 22: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

Many, many thanks to

Klaas Enno Stephan The SPM developers (FIL methods group)

22Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 23: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

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

23Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)

Page 24: Lars@iew.uzh.ch kasper@biomed.ee.ethz.ch Institute for Biomedical Engineering (ETH Zurich) and Empirical Research in Economics (Univ. of Zurich) Z URICH.

ZURICH SPM COURSE 2009

SINGLE SUBJECT ANALYSIS

BATCH PROGRAMMING

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

24Computational Neuroeconomics (Prof. Stephan, IEW) / MR-Technology (Prof. Prüssmann, IBT)

Lars Kasper (11-Feb-09)


Recommended