Introduction to fMRI Analysis with SPM

May 30, 2024

Introduction to fMRI Analysis with SPM

Types of Data Collected

  1. T1 Structural Data

    • High-resolution structural images.
    • ~1mm resolution allowing for detailed anatomical landmarks.
  2. Functional Data

    • Lower resolution compared to structural data.
    • Acquired in real-time during a task.
  3. Field Map Data

    • Records inhomogeneities in the magnetic field (e.g., air pockets from sinuses).

Pre-Processing Steps

1. Obtain Scanner Sequence Information

  • From DICOM headers or printed PDFs from the scanner.
  • Necessary for entering parameters into SPM.

2. Unwarp and Realign Data

  • Uses field map to correct magnetic field inhomogeneities.
  • Restoration of data positioning but not lost data.

3. Slice Timing Correction

  • Functional images acquired in slices over time.
  • Correcting for different time points of acquisition within a TR.

4. Co-registration

  • Aligns functional and structural data into the same space.
  • Ensures anatomical landmarks are aligned.

5. Segmentation

  • Compares structural image to a standard brain template using tissue probability maps (gray matter, white matter, CSF).
  • Generates deformation fields for normalization.

6. Normalization

  • Aligns functional data to standard space using deformation fields.

7. Smoothing

  • Averages activations over multiple voxels.
  • Reduces noise in the data.

Accessing and Using Jupyter with SPM

Setting up PuTTY for Jupyter Access

  • Host Name: “jupyter.mclean.harvard.edu”
  • Enable X11 Forwarding under Connection > X11.

Launching MATLAB

  • Set path to access files.
  • Extract scanner parameters from DICOM headers using dicominfo command.

Using SPM for Pre-Processing

Launching SPM

  • Download and add to MATLAB path.
  • Use Batch Processor for sequential pre-processing steps.
  • Run modules and save batch for future use.

Step-by-Step Pre-Processing in SPM

  1. Field Map Preparation

    • SPM > Tools > Field Map > Calculate VDM
    • Specify phase image, magnitude image, and other parameters.
  2. Realign and Unwarp

    • SPM > Spatial > Realign and Unwarp
    • Select functional images; use calculated VDM from the previous step.
  3. Slice Timing Correction

    • SPM > Temporal > Slice Timing
    • Input TR, slice order, and reference slice.
  4. Co-registration

    • Align mean functional image with structural image.
  5. Segmentation

    • Apply tissue probability maps and save deformation fields.
  6. Normalization

    • Use deformation fields to normalize the data.
  7. Smoothing

    • Dependent on normalized images.

Checking Registration

  • Ensure functional data aligns with the standard brain template.
  • Validate the alignment of anatomical landmarks and edges.

Summary

  • The pre-processing steps include obtaining scanner parameters, unwarping, realignment, slice timing correction, co-registration, segmentation, normalization, and smoothing.
  • Using SPM tools to automate and streamline the pre-processing pipeline.
  • Verifying the quality of registration by comparing functional data to standard brain templates.