Download LYNGBY Matlab toolbox for functional neuroimaging analysis

Transcript
Section 2.4
Data Setup
20
First of all, the vector V is reshaped into a 2D matrix, 64-by-64. Note that this case is
relatively easy because the Jezzard data is only single-slice, so the volume is 64-by-64-by-1. (For
a multiple-slice dataset, you would have to use the reshape function with an extra parameter.
Type help reshape at the Matlab prompt for more information.)
reshape(V,64,64)
Next, the matrix is flipped about the horizontal axis:
flipud(matrix)
and then about the vertical axis:
fliplr(matrix)
Finally, this re-ordered matrix is put back into the vector V with another reshape command:
V = reshape(matrix, 1, 64*64)
This results in a vector V that has been re-ordered so that the elements appear in the same
order that Lyngby is expecting them, i.e. X, Y , Z, X, Y , Z, X, etc with the Z indices changing
the quickest.
Finally, the file is closed with:
fclose(fid);
2.4.3.2
The data paradigm.m and data run.m files
The data paradigm function for the Jezzard data is:
function P = data_paradigm();
P = [kron(ones(3,1), [zeros(10,1) ; ones(10,1))] ; zeros(4,1)];
Another example of a data paradigm function is:
function P = data_paradigm
P = lyngby_kronadd(zeros(8,1), [ zeros(24,1) ; ones(24,1) ; zeros(24,1) ]);
This function was created for an 8 run study with 72 scans in each run: first are 24 base line
scans, then 24 activation scans, and finally 24 base line scans. Note that as well as using this
compact way of specifying the paradigm it is also valid to type the paradigm as a long vector,
i.e. specify the paradigm in long-hand:
function P = data_paradigm
P = [ 0 0 0 1 1 1 0 0 0 ... 0]’;
The total length of the paradigm vector must be the same as the whole time series, i.e.
before the time mask is applied. This is also true for the function defining the run structure —
data run:
c
°Lars
Kai Hansen et al 1997