Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
Introduction to MATLAB for NeuroimagingKRISANNE LITINASUM FMRI LABORATORY
Module 3:fMRI Data and MATLABKRISANNE LITINASUM FMRI LABORATORY
Today’s Concepts
Data storage 3D and 4D matrices Index vs subscript Orthogonal views Correlation and functional connectivity
Brain Imaging Data: 3D Movie
Single slice
Single slice
Single slice: 2D matrix
1
2
3
4
5
6
7
8
9
M
Single slice: 2D matrix
Linear Index Subscripts (row, col)
Single slice: 2D matrix
Linear Index Subscripts (row, col)
M(8) = M(2,3)
Multiple slices: from 2D to 3D
Linear Index Subscripts (row, col, slice)
M(7) = M(1,2,2)
Multiple slices: from 2D to 3D
…. Same thing to make a 4D matrix
Whole brain as a 3D matrix
XX
Whole brain as a 3D matrix
Y
Y
Whole brain as a 3D matrix
Z
Z
Brain as a 4D matrix (time series)
𝒕𝒕
𝒙𝒙
𝒚𝒚𝒛𝒛
𝑻𝑻𝑻𝑻𝟏𝟏 𝑻𝑻𝑻𝑻𝟐𝟐 𝑻𝑻𝑻𝑻𝟑𝟑
𝑀𝑀(𝑥𝑥,𝑦𝑦, 𝑧𝑧, 𝑡𝑡)
𝑀𝑀(𝑖𝑖𝑖𝑖𝑖𝑖)Index:
Subscript:
A 3D data set as a vector
𝑻𝑻𝑻𝑻𝟏𝟏
A 4D data set as a 2D matrix (!)
Image Storage
All the pixel values are stored sequentially Headers: contains information needed to display an image AVW and NIFTI formats
Linear Regression Review
We have a bunch of measurements of 𝑥𝑥 and 𝑦𝑦 Model the relationship as linear:
Solve for 𝑚𝑚 and 𝑏𝑏 If the model is true, 𝑥𝑥 and 𝑦𝑦 are correlated
𝑦𝑦 = 𝑚𝑚𝑥𝑥 + 𝑏𝑏 + 𝜀𝜀
Expand to Matrix Form
Now with many variables:
𝑦𝑦 = 𝑚𝑚𝑥𝑥 + 𝑏𝑏 + 𝑒𝑒
Y= 𝑋𝑋𝛽𝛽 + 𝜀𝜀𝑌𝑌1𝑌𝑌2⋮𝑌𝑌𝑛𝑛
=
1 𝑋𝑋11 ⋯ 𝑋𝑋1𝑝𝑝1⋮1
𝑋𝑋21⋮𝑋𝑋𝑛𝑛1
⋯
⋯
𝑋𝑋2𝑝𝑝⋮
𝑋𝑋𝑛𝑛𝑝𝑝
𝛽𝛽0𝛽𝛽1⋮𝛽𝛽𝑝𝑝
+𝜀𝜀0𝜀𝜀1⋮𝜀𝜀𝑛𝑛
Design Matrix Observed Data
Model Params.
Error
time
Linear Regression Review
Solve for terms, do fancy math with matrices
𝑌𝑌 = 𝑋𝑋𝛽𝛽 + 𝜀𝜀
𝜀𝜀𝑒𝑒𝑒𝑒𝑒𝑒 = 𝑌𝑌 − 𝑋𝑋 ∗ 𝛽𝛽𝑒𝑒𝑒𝑒𝑒𝑒
𝑇𝑇𝑒𝑒𝑠𝑠𝑠𝑠𝑠𝑠𝑒𝑒(𝑛𝑛) =𝛽𝛽𝑒𝑒𝑒𝑒𝑒𝑒
𝑠𝑠𝑡𝑡𝑖𝑖𝑒𝑒𝑠𝑠(𝜀𝜀𝑒𝑒𝑒𝑒𝑒𝑒 𝑛𝑛 )
𝛽𝛽𝑒𝑒𝑒𝑒𝑒𝑒 = (𝑋𝑋)−1∗ 𝑌𝑌
Linear Regression Applied: Functional Connectivity
Pixel of interest for study Want to find other pixels in synch… possible connections?
Y= 𝑋𝑋𝛽𝛽 + 𝜀𝜀𝑌𝑌1𝑌𝑌2⋮𝑌𝑌𝑛𝑛
=
1 𝑋𝑋11 ⋯ 𝑋𝑋1𝑝𝑝1⋮1
𝑋𝑋21⋮𝑋𝑋𝑛𝑛1
⋯
⋯
𝑋𝑋2𝑝𝑝⋮
𝑋𝑋𝑛𝑛𝑝𝑝
𝛽𝛽0𝛽𝛽1⋮𝛽𝛽𝑝𝑝
+𝜀𝜀0𝜀𝜀1⋮𝜀𝜀𝑛𝑛
Design Matrix Observed Data
Error
time
Linear Regression Applied: Functional Connectivity
Pixel of interest for study Want to find other pixels in synch… possible connections? The model for all pixels is the time course of the “seed pixel”.
𝑌𝑌1𝑌𝑌2⋮𝑌𝑌𝑛𝑛
=
1 𝑋𝑋111⋮1
𝑋𝑋21⋮𝑋𝑋𝑛𝑛1
𝛽𝛽0𝛽𝛽1
+𝜀𝜀0𝜀𝜀1⋮𝜀𝜀𝑛𝑛
Observed Data
Model Params.
Error
time
Seed Pixel
The Lab Exercise
Read in NIFTI and Analyze format Understand data ordering Navigate and display the time series Do a “connectivity analysis”
Use regression
Use all data as a single matrix