introduction to matlab for neuroimaging
TRANSCRIPT
![Page 1: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/1.jpg)
Introduction to MATLAB for NeuroimagingKRISANNE LITINASUM FMRI LABORATORY
![Page 2: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/2.jpg)
Module 3:fMRI Data and MATLABKRISANNE LITINASUM FMRI LABORATORY
![Page 3: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/3.jpg)
Todayโs Concepts
Data storage 3D and 4D matrices Index vs subscript Orthogonal views Correlation and functional connectivity
![Page 4: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/4.jpg)
Brain Imaging Data: 3D Movie
![Page 5: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/5.jpg)
Single slice
![Page 6: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/6.jpg)
Single slice
![Page 7: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/7.jpg)
Single slice: 2D matrix
1
2
3
4
5
6
7
8
9
M
![Page 8: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/8.jpg)
Single slice: 2D matrix
Linear Index Subscripts (row, col)
![Page 9: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/9.jpg)
Single slice: 2D matrix
Linear Index Subscripts (row, col)
M(8) = M(2,3)
![Page 10: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/10.jpg)
Multiple slices: from 2D to 3D
Linear Index Subscripts (row, col, slice)
M(7) = M(1,2,2)
![Page 11: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/11.jpg)
Multiple slices: from 2D to 3D
โฆ. Same thing to make a 4D matrix
![Page 12: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/12.jpg)
Whole brain as a 3D matrix
XX
![Page 13: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/13.jpg)
Whole brain as a 3D matrix
Y
Y
![Page 14: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/14.jpg)
Whole brain as a 3D matrix
Z
Z
![Page 15: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/15.jpg)
Brain as a 4D matrix (time series)
๐๐
๐๐
๐๐๐๐
๐ป๐ป๐ป๐ป๐๐ ๐ป๐ป๐ป๐ป๐๐ ๐ป๐ป๐ป๐ป๐๐
๐๐(๐ฅ๐ฅ,๐ฆ๐ฆ, ๐ง๐ง, ๐ก๐ก)
๐๐(๐๐๐๐๐๐)Index:
Subscript:
![Page 16: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/16.jpg)
A 3D data set as a vector
๐ป๐ป๐ป๐ป๐๐
![Page 17: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/17.jpg)
A 4D data set as a 2D matrix (!)
![Page 18: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/18.jpg)
Image Storage
All the pixel values are stored sequentially Headers: contains information needed to display an image AVW and NIFTI formats
![Page 19: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/19.jpg)
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
๐ฆ๐ฆ = ๐๐๐ฅ๐ฅ + ๐๐ + ๐๐
![Page 20: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/20.jpg)
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
![Page 21: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/21.jpg)
Linear Regression Review
Solve for terms, do fancy math with matrices
๐๐ = ๐๐๐ฝ๐ฝ + ๐๐
๐๐๐๐๐๐๐๐ = ๐๐ โ ๐๐ โ ๐ฝ๐ฝ๐๐๐๐๐๐
๐๐๐๐๐ ๐ ๐ ๐ ๐ ๐ ๐๐(๐๐) =๐ฝ๐ฝ๐๐๐๐๐๐
๐ ๐ ๐ก๐ก๐๐๐๐๐ ๐ (๐๐๐๐๐๐๐๐ ๐๐ )
๐ฝ๐ฝ๐๐๐๐๐๐ = (๐๐)โ1โ ๐๐
![Page 22: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/22.jpg)
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
![Page 23: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/23.jpg)
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
![Page 24: Introduction to MATLAB for Neuroimaging](https://reader030.vdocuments.mx/reader030/viewer/2022012512/618b0d9279fd9424e4129a62/html5/thumbnails/24.jpg)
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