Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first:...

34
Introduction to fMRI Pre-processing Tibor Auer Department of Psychology Research Fellow in MRI

Transcript of Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first:...

Page 1: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

Introduction to fMRI–

Pre-processing

Tibor AuerDepartment of PsychologyResearch Fellow in MRI

Presenter
Presentation Notes
Do the talking during running that step!
Page 2: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Anatomical data: T1-weighted, 3D, 1/subject or session- (ME)MPRAGE/FLASH sequence, undistorted- High spatial resolution (~1 mm isotropic)- Optimised for structural contrast1

- Acquisition time ~5 minutes

• Functional data: T2*-weighted, 4D, 1/measurement- EPI sequence, distorted- Lower spatial resolution (2-3 mm non-isotropic)- Optimised for functional contrast2

- Acquisition time ~2 seconds (20-30 slices)

• Fieldmaps: 2×3D, 1/session- Dual-echo GE sequence, undistorted- Lower spatial resolution (same as fMRI)- Map of magnetic field inhomogeneities- Acquisition time ~1 minute.

Data – Types

Presenter
Presentation Notes
structural contrast between white and grey matter functional contrast between oxy- and deoxygentated blood
Page 3: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Time series

- showing BOLD signal changes

- in each point in the brain

3D

- at each repetition (e.g. 2 seconds)

+1D

Data – Functional

Time

BOLD signal

Time

Page 4: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

Challanges Solutions• Different people’s brains are different shapes

• EPI images are distorted

• The head is likely to move during the fMRI scan

• Slices within the same image come from different time points (assuming standard 2D EPI)

• Head movements between fMRI scans and structural scans

• Signal is typically spatially smoothed

• HRF is delayed and temporally smooth

• Signal intensity drifts over time

• Normalisation to template (MNI)

• Undistort using B0 fieldmap

• Spatial realignment (rigid-body)

• Temporal realignment (slicetiming)

• Coregister (headers only)

• Spatial smoothing

• Just model it (next lecture)!

• Just model it (next lecture)!

Overview – Challanges

Courtesy to Johan Carlin

Page 5: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

Challanges Interactions• Different people’s brains are different shapes

• EPI images are distorted

• The head is likely to move during the fMRI scan

• Slices within the same image come from different time points (assuming standard 2D EPI)

• Head movements between fMRI scans and structural scans

• Signal is typically spatially smoothed

• HRF is delayed and temporally smooth

• Signal intensity drifts over time

Overview – Challanges

realignunwarp

realign – slicetiming ordering

Preprocessing is no substitutefor collecting high quality data!

Courtesy to Johan Carlin

Page 6: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

Overview

Images in dicomformat

Convert to format used by SPM (NIFTI)

Within series processing:• Spatial realignment• Undistortion• Temporal realignment

CoregisterEPI to structural

Normalise structural

Normalise EPI

Smooth EPI

Single subject stats

Group stats Publish…

Initial image diagnostics

Page 7: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

Overview – aa modules (aamod_*)

autoidentifyseries_timtrioget_dicom_structuralget_dicom_epiget_dicom_fieldmap

convert_structuralconvert_episconvert_fieldmapsfieldmap2VDM

realignunwarpslicetiming

coreg_extended_2epi biascorrect_structural

coreg_extended_1

segment8_multichan

dartel_createtemplate

dartel_norm_write

+

freesurfer_initialise

freesurfer_autorecon_all

norm_write_dartel

worm_write_meanepi_dartel

smooth

firstlevel_model

firstlevel_contrasts

firstlevel_threshold

firstlevel_threshold_register2FS

secondlevel_model paper_maker ???

tsdiffana

Page 8: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Scaled variance of difference from the 1st vol.:

- Volumewise

- Slicewise

• Descriptive stats:

- Volumewise mean

- Slicewise variance

Preprocessing – Initial diagnostics

Mean and varianceimages:

Diagnostic plots:

Page 9: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• People have different shaped brains Transforming brains to a common template- Group studies- Cross study comparison, meta analysis

• Template: universal space- Talairach and Tournoux, 1988 (based on a single subject)

- Montreal Neurological Institute: MNI152 Averaged from T1 images of 152 subjects

- Information eXtraction from Images (London): IXI (in SPM12) Also in MNI Fewer (but growing number of) subjects, geographically more representative More tissue classes (segmentation)

Preprocessing – NormalizationChallenge

Presenter
Presentation Notes
SPM, FSL uses MNI152 Brain Voyager uses T&T mni2tal.m, tal2mni.m
Page 10: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Direct:

1. EPI MNI modality + resolution/smoothness + shape

• Indirect (Coreg1+Norm):

1. Structural MNI smoothness + shape

2. EPI StructuralMNI modality + resolution

• Indirect+ (Coreg1+DARTEL+Norm):

1. Structural Study template smoothness + shape (intermediate)

2. Study template MNI shape (intermediate)

3. (Structural Study template MNI)

4. EPI Structural Study template MNI modality + resolution

Preprocessing – NormalizationApproaches

Presenter
Presentation Notes
Discussed in fMRI
Page 11: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Affine (12 DOF) registration:

- 3 translations

- 3 rotation

- 3 shears

- 3 zooms

Preprocessing – NormalizationTransformation

Zoom

Shear

Rigid-body(6DOF)

Page 12: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Linear transformations:

- Assumes linear relationship between position and transformation

- Able to match overall size and shape, but not small details

• Nonlinear transformations:

- Deformation fields: nonlinear relationship between position and transformation

large DOF Caveat: overfitting (unnecessary warps) make a brains exactly the same

- Regularisation: transformation within a certain range based on a priori knowledge1

Preprocessing – NormalizationTransformation

Presenter
Presentation Notes
1. We know, how a brain look like
Page 13: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Nonlinear transformations:

Preprocessing – NormalizationTransformation

Template Affine only• some differences

in shape

Affine + nonlinear with regularization• good match to

overall shape• some differences

in details

Affine + nonlinear without regularization• overfitting

Page 14: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Coreg1+Norm:

1. Structural MNI smoothness + shape non-linear via segmentation2

2. EPI StructuralMNI modality + resolution rigid-body (6DOF)

• Coreg1+DARTEL+Norm:

1. Structural Study template smoothness + shape (intermediate) non-linear via segmentation2

2. Study template MNI shape (intermediate) affine (12DOF)

3. (Structural Study template MNI)

4. EPI Structural Study template MNI modality + resolution rigid-body (6DOF)

Preprocessing – NormalizationImplementation

Presenter
Presentation Notes
Discussed in fMRI Unified segmentation: Normalise each tissue classes separately to a template. Much better than whole-image normalisation, if the segmentation is good.
Page 15: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Diagnostics

Preprocessing – NormalizationSegmentation

Presenter
Presentation Notes
0: spm_check_registration
Page 16: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Diagnostics

Preprocessing – NormalizationSegmentation

Presenter
Presentation Notes
0: spm_check_registration
Page 17: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Movement confounds data:

- Signal recorded from different position

Correspondence

PVE (e.g. WM – GM)

- Signal recorded at a different field strength

Local inhomogeneities in the magnetic field affecting the brain area

Preprocessing – Motion correctionChallenge

Page 18: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Movement confounds data:

- Signal recorded from different position

Correspondence

PVE (e.g. WM – GM)

• Motion correction: transform each volume to the first

- same modality, same resolution, same shape Rigid-body (6DOF)

Preprocessing – Motion correctionSolution

Page 19: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Movement confounds data:

- Signal recorded at a different field strength

Local inhomogeneities in the magnetic field affecting the brain area

• Motion correction with Unwarping:

- Iteratively estimate the effects and compensate for them

Preprocessing – Motion correctionSolution

Motion correction

Estimate “derivative

fields”1

Compensate “derivative

fields”

Until minimal change in remaining variance

Presenter
Presentation Notes
derivative fields: how distortions at any point change with movement
Page 20: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Movement confounds data:

- No corection is perfect

Residual effect of motion

• Include the realignment parameters as covariates in the statistical model

- Capture any movement related variance in the data.

- However!

Reduces design’s degree of freedom (usually > 100)

Problematic if movement is correlated with effects of interest

(e.g. button pushes, verbal responses etc.)Can remove the effects of interest.

Preprocessing – Motion correctionSolution

Page 21: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

Preprocessing – Motion correctionDiagnostics

QAMoCo parameters

Presenter
Presentation Notes
Compensation is not 100% Rapid movements within a scan Spin history effects
Page 22: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Best solution: reduce movement to the minimum

- Comfort1

- Discourage talk during breaks (between-session movement2)

- Dummy scans, Instructions

- “End of measurement”

• Reject data to reduce heterogeneity (Summary)

- Scans

- Subjects

Preprocessing – Motion correctionDiagnostics

Presenter
Presentation Notes
relax neck and shoulders Auto-align sequence
Page 23: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Summary (outliers)

- Trans - x: None

- Trans - y: 12

- Trans - z: 1

- Pitch: None

- Roll: 19

- Yaw: 19

Preprocessing – Motion correctionDiagnostics

Page 24: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

Preprocessing – Motion correctionDiagnostics

Subject #19 MoCo parameters Subject #2 MoCo parameters

Page 25: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Acquisition

- 2D EPI sequence collect volume slice-by-slice

- Each slice is acquired at a different time

- TR = 2s, 32 slices:

62.5 ms between-slice difference

~1.9 s difference between the first and the last slices

- Confound precise timing if TR is long (> 1s)

Event-related vs. epoch-based

Preprocessing – Temporal realignmentChallenge

Page 26: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Slice time correction

- Interpolate timecourse1

• Implementation

- Preprocessing:

Calculate time shift

“Tags” slices

- Interpolation during HRF-estimation

Preprocessing – Temporal realignmentSolution

0 1 2 3 4 5 6 7 8 92468

0 1 2 3 4 5 6 7 8 9-202

0 1 2 3 4 5 6 7 8 9-202

0 1 2 3 4 5 6 7 8 9-202

0 1 2 3 4 5 6 7 8 9-202

Time (in TRs)

Presenter
Presentation Notes
What would be the signal, had it been acquired at the time of the reference slice?
Page 27: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Sliceorder/Slice timings

- Timings are more accurate than orders

- Specified manually (automatic in aa!)

• Reference slice: all other slices will be “adjusted” to it

- Middle slice: ↓ the maximum interpolation necessary ↓ interpolation artefacts

- It will not be altered: Chose according to your area of interest!

- Caveat:

Scanner sync pulse is at the acquisition of the first slice- Stimuli timing adjusted to the first slice

or

- Model needs to be adjusted (automatic in aa!)

Preprocessing – Temporal realignmentImplementation

Page 28: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Slices acquired at different time pointsspin history effects

- Movement against slice direction Striping

- Interleaved: If you move up 1 voxel, the slices are excited every 1/2 or 3/2 TR instead of 1/1.

- Movement by slicetime interaction

Can’t correct

Motion parameters won’t show(but imply/correlate)

- Need to look at your data!

Preprocessing – Motion correction and Temporal Realignment

Courtesy to Danny Mitchell

No motion Motion

Interleaved

Sequential

Page 29: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Principle:

- Slice time first:

+ slice timing is fixed

- non-linear (i.e. non-correctable) spatial effects in your data if there is head motion

- Realign first:

+ head motion is fixed

- slice timings are a little bit wrong sometimesdue to head movement

Preprocessing – Motion correction and Temporal Realignment

Courtesy to Johan Carlin

• Guidelines

- Realign first if you use a sequential acquisition (slices are ~50ms apart) timing errors will be small

- Slice time correct first if you use an interleaved acquisition, where timing errors could be large

- Don’t bother with slice time correction if:

You acquire the slab at once (3D EPI) or TR is extremely short (e.g. multi-band)

If you plan to model HRF shape (FSL solution) Cave: overfitting!

Page 30: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Goal: the functional in the same space as the structural

- Overlay functional results onto the structure to enhance localisation

- Use structural as a precursor to spatial normalization: EPI StructuralMNI

• Data types

- Reference image: Structural: T1-weighted, high resolution, fewer artefacts

- Source image: Functional: T2*-weighted, low resolution

modality + resolution, but same shape Rigid-body (6DOF)

Preprocessing – CoregistrationChallenge

Presenter
Presentation Notes
1. See earlier
Page 31: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Functional image to estimate transformation

- example EPI from ca. the middle – FSL

- mean EPI (temporally averaged) – SPM

Smoothed: lower noise level vs. smaller (effective) spatial resolution

• Requirements

- Reasonably good starting point (local optima)

Similar acquisition position (AutoAlign)

Reorient (?)

- Adequate overlapping with structural partial-brain fMRI requires two-step coregistration via a “whole-brain EPI”1

1. Whole-brain EPI Structural

2. Partial-brain EPI Whole-brain EPI Structural

Preprocessing – CoregistrationSource image

Presenter
Presentation Notes
1. Same session
Page 32: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Spatial weighted averaging: usually Gaussian kernel

- Value at each voxel: a weighted average of the values in surrounding voxels

- ↑ signal-to-noise ratio: assuming random noise

- Signal spread (depends on kernel size):

↑ between-subject spatial correspondence (by blurring minor differences)

↓ effective spatial resolution (RESEL) ↓ the number of multiple comparisons

“False” positives (voxel wise)!

Preprocessing – Smoothing

Original signal Signal plus noise Recovered signalApply kernelto each point

Page 33: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

• Amount to smooth:

- Full Width at Half Maximum height (FWHM)

- Ideally: hypothesis-dependent1

According to the spatial extent of the signal

Neuroanatomical assumptions

- Visual areas: smaller kernel

- Prefrontal: larger kernel

- Methodologically: GRFT-dependent (inference)

Ensure minimum smoothness (RESEL ≥ 3×voxel)

Iterative?

- Practically:

Resolution-dependent: 1.5×voxel-size

8-10 mm is common (SPM default, history!)

Preprocessing – SmoothingKernel Size

FWHM

Presenter
Presentation Notes
1. Any smaller activation will be blurred over
Page 34: Introduction to fMRI Pre-processing - CUBIC | RHUL CUBIC 2018-01-25 · head motion - Realign first: + head motion is fixed - slice timings are a little bitwrong sometimes due to .

Questions?

House, M.D. Los Angeles, CA: Fox Broadcasting