fMRI: Biological Basis and Experiment Design Lecture 23: GLM in multiple voxels Errata Final project review Keeping track of space Multi-voxel GLM Before After x
Erratum: ICE9 % Repeat the "experiment" a few times %%!!! Wrong way... shouldn't run the same design again and again - then %%the experimental conditions aren't nearly as randomized as they could %%be! nScans = 10; clear data for n = 1:nScans data(n,:) = caoSimulateData(neural,TR,BOLDamp,SNR,1); end % "Analyze" data... % %Check out code that does TTA... TTAlength = 20; [TTA TTAsem count] = caoComputeTTA(design,data,TTAlength); TTA_minus_baseline = TTA - repmat(TTA(:,1),[1 size(TTA,2)]); subplot(2,1,1) errorbar(repmat((0:(TTAlength-1))',[1 size(TTA,2)]),TTA,TTAsem); title(['nScans = ' num2str(nScans)]); axis tight subplot(2,1,2) errorbar(repmat((0:(TTAlength-1))',[1 size(TTA,2)]),TTA_minus_baseline,TTAsem); title(['nScans = ' num2str(nScans)]); axis tight legend(num2str(count))
Erratum: ICE9 % Repeat the "experiment" a few times % Right way - new trial order each repetition nScans = 10; fixedLength = 500; design = zeros(nScans,fixedLength); neural = zeros(nScans,fixedLength); data = zeros(nScans,fixedLength); for n = 1:nScans % For this, I'd built in a flag that would make the design vector the % same length each time (adding 0's at end) to deal with the fact that % randomized ISI's yield unpredictable scan lengths design(n,:) = caoMakeER(waitUpFront,nStimTypes,ISIrange,nStim,500); for nt = 1:length(design) if design(n,nt) % if there's a stimulus neural(n,nt) = relResp(design(n,nt)); % pick the appropriate response end data(n,:) = caoSimulateData(neural(n,:),TR,BOLDamp,SNR,1); end
Basic assignment, final project (all projects need these components) Abstract (250 words) Background - experiment design and neuroscience question motivating the experiment (1 page, references) Methods (2 – 4 pages) –MR Methods section (resolution, TR, TE, protocol) –Prediction of neural activity –Prediction of BOLD response (noiseless model) –Simulated data (BOLD + noise - physiological and/or thermal) –ROI selection –GLM Results (1 – 3 pages) –Paragraph describing simulation output + 1 figure –Paragraph describing GLM results + 1 figure Discussion (1 - 2 pages) –3 things that might not be as expected if you ran the experiment
Building blocks, final project (weekly assignments, 2 nd half of semester) Abstract (250 words) Background - experiment design and neuroscience question motivating the experiment (1 page, references) Methods (2 – 4 pages) –MR Methods section (resolution, TR, TE, protocol) – WA 8 –Prediction of neural activity – WA7 –Prediction of BOLD response (noiseless model) – WA7 –Simulated data (BOLD + noise - physiological and/or thermal) – WA8 –ROI selection –GLM – WA10 & WA11 Results (1 – 3 pages) –Paragraph describing simulation output + 1 figure – WA8 –Paragraph describing GLM results + 1 figure – WA10 & WA11 Discussion (1 - 2 pages) –3 things that might not be as expected if you ran the experiment
Presentation schedule Groups –Denkinger –Han, Honwanishkul, Roher –Haut, Johnson –Kruse, White –Kwon –Liu, Schmidt –Seo, Vizueta –Theodorou –Thompson Times –May 2 9:45 – 10:05 Kwon 10:05 – 10:25 Theodorou 10:25 – 10:45 Denkinger 10:45 – 11:15 Big group HHR –May 4 9:45 – 10:05 Thompson 10:05 – 10:25 Big group 10:25 – 10:45 Seo, Vizueta 10:45 – 11:15 Haut, Johnson
A 1,1 A 2,1 A 3,1 A 4,1 A 1,2 A 2,2 A 3,2 A 4,2 A 1,3 A 2,3 A 3,3 A 4,3 A 1,m A 2,m A 3,m A 4,m Linear model for BOLD in a single voxel A = x = x1x2x3x4x1x2x3x4 y = y1y2y3ymy1y2y3ym Ax = y Design matrix, [m x n] - m time-points - n stimulus types Data [m x 1] - response through time Responses [n x 1] - for each stimulus, a scalar (single number) representing how well that voxel responds to that stimulus...
A 1,1 A 2,1 A 3,1 A 4,1 A 1,2 A 2,2 A 3,2 A 4,2 A 1,3 A 2,3 A 3,3 A 4,3 A 1,m A 2,m A 3,m A 4,m Linear model for BOLD in multiple voxels A = x = x 1,1 x 2,1 x 3,1 x 4,1 y = y 1,1 y 2,1 y 3,1 y m,1 Ax = y Design matrix, [m x n] - m time-points - n stimulus types Data [m x p] - response through time Responses [n x p] - for each stimulus, a scalar (single number) representing how well that voxel responds to that stimulus x 1,2 x 2,2 x 3,2 x 4,2 x 1,p x 2,p x 3,p x 4,p y 1,2 y 2,2 y 3,2 y m,2 y 1,p y 2,p y 3,p y m,p...
Keeping track of voxels 2D (or 3D) array of data 1D vectorX & Y (& Z) coords =+
Fake experiment – distributed neural activity Brain (3 types of responses) 3 types of stimuli; 3 types of "neuron" (voxel?)
Fake experiment – simulated data Brain (3 types of responses) voxels (Baseline trends, noise dominate visualization)
Design Matrix - Stimulus 1 - Stimulus 2 - Stimulus 3 - Linear drift - Half-cycle cos drift cycle cos drift
Design Matrix + (sim.) data X= ? time voxels
(An aside on rows and columns) Why do [nTpts nVoxels] instead of [nVoxels nTpts]? –Typical experiment 6 scans, 200 tpts per scan --> nTpts = brain, 64 x 64 x 30 voxels --> nVoxels = 122,880 –Size of A [nTpts nVoxels]: [122, ] [nVoxels nTpts]: [ ,880] –Size of A T A [nTpts nVoxels]: [ ] [nVoxels nTpts]: [122, ,880] !
Estimate of voxel responses X= time voxels x est = x + = (A T A) -1 A T (y + )
Estimate of voxel responses Response to Stim1Response to Stim3Response to Stim2 Estimated Input
WA10 – Build design matrix & GLM analysis tool