Homework 5

FMRI data analysis

We created the boxcar model and took the shape of the BOLD response into account by convolving it with the hemodynamic response function. We achieved this with the following Matlab code:

close all; set(0,'defaultlinelinewidth',1.5); load hrf_response.mat load ROI_data.mat nscan = 6; ntot = 96; tr = 7; time = linspace(0,ntot*tr,ntot*tr); box_car = repmat([zeros(1,nscan*tr),ones(1,nscan*tr)],1,ntot/nscan/2); plot(time, box_car); ylim([-0.2, 1.2]); xlim([0,tr*ntot]); xlabel('time [s]'); ylabel('stimulus onset'); % Convolve the stimulus vector with hemodynamic response function model = conv(box_car, hrf_1s, 'full'); model = model(1:ntot*tr); hold on; plot(time, model);

The result can be seen in Fig. \ref{fig_model}.


Next we performed the statistical analysis with a p-value of 0.001 and after that with a Bonferroni corrected p-value of 0.05. As can be seen in Fig. \ref{fig_pvalues} the left and right ROIs have statistically significant responses for both p-values. The Bonferroni correction did not destroy our results. We used the following code:

% Decimate the model by factor 7 model_7s = decimate(model, 7); % Leave out first 12 samples model_7s = model_7s(13:end); %% Fit the different ROIs p_left = zeros(size(ROI_left,2),1); % Fit the model and compute t-statistics for i=1:size(ROI_left, 2) [bl, dev, stats] = glmfit(model_7s',ROI_left(:,i), 'normal'); p_left(i) = stats.p(2); end figure('position', [200 365 1e+03 340.8000]); subplot(1,3,1); semilogy(p_left,'.-'); axis tight; hold on; semilogy(xlim, [0.001, 0.001]); semilogy(xlim, [0.05, 0.05]/size(ROI_left,2)); ylim([1e-16,1.1]); title('Left'); ylabel('p-value'); xlabel('Voxel number'); p_right = zeros(size(ROI_right,2),1); % Fit the model and compute t-statistics for i=1:size(ROI_right, 2) [br, dev, stats] = glmfit(model_7s',ROI_right(:,i), 'normal'); p_right(i) = stats.p(2); end subplot(1,3,2); semilogy(p_right,'.-'); axis tight; hold on; semilogy(xlim, [0.001, 0.001]); semilogy(xlim, [0.05, 0.05]/size(ROI_right,2)); ylim([1e-16,1.1]); title('Right'); xlabel('Voxel number'); p_unrelated = zeros(size(ROI_unrelated,2),1); % Fit the model and compute t-statistics for i=1:size(ROI_unrelated, 2) [bu, dev, stats] = glmfit(model_7s',ROI_unrelated(:,i), 'normal'); p_unrelated(i) = stats.p(2); end subplot(1,3,3); semilogy(p_unrelated,'.-'); axis tight; hold on; semilogy(xlim, [0.001, 0.001]); semilogy(xlim, [0.05, 0.05]/size(ROI_unrelated,2)); ylim([1e-16,1.1]); title('Unrelated'); xlabel('Voxel number'); legend('Voxel p-value', '0.001 threshold', 'Bonferroni threshold', ... 'Location', 'SouthEast');

Results can be seen in Fig. \ref{fig_pvalues}. Voxels with p-value smaller than the threshold are considered significant.