[MINC-users] fMRIstat event-related questions + error

Roy Yves yves.roy@umontreal.ca
Tue Aug 24 12:39:03 2004


Dear BIC users:
 
I have a question concerning an fMRI event-related study on
language processing using fMRIstat.
1) Question on duration of events
2) Error in Matlab
___________________________
1)
The study roughly consists in presenting visual stimuli of strings
of characters and the subjects have to answer whether the stumulus
was a word of high imageability, low imageability, a non-word, or
for a baseline condition, a string of capital or small letters (so
4 conditions/regressors).
Amond other things, I am looking for guidelines on how to set
the duration (of events) values in the events matrix. for event-related
(I know it may depends on the actual experiment and what the
neuropsychologist  looking for but still, guidelines would be welcome).
mouldy 104% 
* visual stimuli last 200ms, and where,
* a subject has to answer as to the nature of the stimulus and where
* stimuli belonging to different conditions are separated in time by an
  ISI (inter-stimulus interval) ranging from 2000ms to 3000ms, and where
* the subject is allowed 1500ms after the beginning of the stimulus,
how should I go about determining the event duration:
a) 0 (default value in fMRIstat)
b) 200 ms (duration of the stimulus itself)
c) actual subject response time
d) ISI
Some people I talked to suggested 0 ms, some the ISI, and some told me
to be cautions in that choice (pointing to the article by
Randy Buckner: Event-Related fMRI and the Hemodynamic Response,
HBM 6:373-377(1998).
I am looking for values commonly used in similar situations, as well as
justification/rationale behind that choice (if you are aware of some interesting papers on the topics as well). 
 
2)
Here is the batch I ran:
%_________________________________________________________________
% Batch for the definition of the design matrix and parameter estimation
% for a single subject, one run.
% TR = 3s,
% 103 frames per run = 309 seconds/run
% frametimes is a row vector in which you enter the time, in seconds
% at which each frame was acquired.
%______________________________________________________________
%
% Q? - The frametimes defined below just uses the known TR set
% in the scanner when the experiment was defined. How to ensure
% that the frametimes defined like this always corresponds to
% the frametimes as found in the minc images?
%_______________________________________________________________
frametimes = (0:102) * 3;
%_______________________________________________________
% MOSAIC 24 ascending:
% Delay between beginning of frame and first slice: 0ms
% Time between slices: ~92ms (for 64x64)
% Number of slice per volume: 28
% Acquisition: ascending, interleaved
:q
bullcalf 122% more batch.m 
%_________________________________________________________________
%
% Analysis for subject 5 A-B, run 1
%_________________________________________________________________
% TR = 3s, 
% 103 frames per run = 309 seconds/run
% frametimes is a row vector in which you enter the time, in seconds
% at which each frame was acquired.
%______________________________________________________________
%
% Q? - The frametimes defined below just uses the known TR set 
% in the scanner when the experiment was defined. How to ensure
% that the frametimes defined like this always corresponds to
% the frametimes as found in the minc images?
%_______________________________________________________________
frametimes = (0:102) * 3;
%_______________________________________________________
% MOSAIC 24 ascending:
% Delay between beginning of frame and first slice: 0ms
% Time between slices: ~92ms (for 64x64)
% Number of slice per volume: 28
% Acquisition: ascending, interleaved 
% (first slice = bottom slice i.e. slice labeled 1 in MINC file so that:
%       #1___ __W__     
%       #2___/     \    ^\    |
%       #3__@  o o  @   | \   ^
%        :__|   u   |   ^  \  |  Ascending, interleaved
%     #N-1___\  -  /    |   \ ^
%       #N____\___/     ^    \|
%
% slice number:   1     2   ...   N-2   N-1  N=28 
% slicetimes = [             ...  0.920 1.840  0  ])
%
% slicetimes is a row vector of relative slice acquisition times.
%_______________________________________________________________
% 
% Q1? - time relative to the frametimes, i.e. in descending
% sequential acquisition, a slice time of 0 for slice #1
% means that the first slice started to be acquired at the
% same time the frame started to be acquired 
% (0 seconds after, without a delay). Is that correct?
% 
% Q2? - Can I find the slice acquisition time in the minc files?
%_______________________________________________________________
numslices = 28;
interslice = 0.092;
% Descending order
slicetimes = ((numslices - 1):-1:0) * interslice;
% Takes care of the interleaved acquisition
slicetimes_odd = slicetimes(1:numslices/2);
slicetimes_even = slicetimes(numslices/2+1:numslices);
slicetimes(1:2:numslices) = slicetimes_odd;
slicetimes(2:2:numslices) = slicetimes_even;
% events is a matrix of events whose rows are events
% and columns are:
% 1- events ids: an integer from 1 to N=number of events, to identify 
%                the event type.
% 2- event times: start of event, synchronized with frame and slice times.
% 3- durations: (optional, default is 0) duration of the event.
% 4- heights: (optional, default is 1) height of response for event. 
%
% Here, events ids correspond to:
% 1 <=> Word, high imageability
% 2 <=> Word, low imageability
% 3 <=> Non-Word
% 4 <=> Baseline (strings of same letters in capital or small letters) 
%
% The onset values and durations were extracted from the 
% stimuli presentation program. Here we use the ISI for the
% durations and the target onset times for the event times.
% Other choices are possible for the durations....
% events has 120 rows, since there are 120 stimuli in this run.
events = [ 
2 36.338 2.25 1
4 38.606 2.0 1
2 40.606 2.5 1
1 43.106 2.25 1
3 45.356 2.0 1
1 47.356 3.0 1
4 50.356 2.75 1
1 53.106 3.0 1
4 56.106 2.0 1
3 58.106 3.0 1
3 61.106 2.0 1
...
1 324.606 3.0 1
4 327.606 2.75 1
1 330.356 2.0 1
2 332.356 2.5 1]
 
 
%__________________________________________________________
%
% Q? - When to include the baseline in the condition,
%      when not to? What is the rational behind that choice?
%      This has an impact on how we define the contrast matrix (see below)
%___________________________________________________________
% Making the design matrices using fmridesign
X_cache=fmridesign(frametimes,slicetimes,events);
 
% Defining contrasts
% A matrix whose rows are contrasts for the statistic images (for the
% response variables) with row length equals to number of regressors
% variables in X_cache, and columns are the contrasts.
%
% For example here (regardless of the correctness of the subject answer),
% if were are interested in the regions of the brain activated when
% high imageability words are presented, i.e. condition 1 minus
% the baseline, we would define this contrast in the following manner:
contrast = [ 1 0 0 -1]

% contrast is a matrix with 4 columns (since there are 4 conditions, 4 regressors)
 
 
% Frames to exclude from the analysis:
% - First few frames of functional run (not steady-state image)
% - other frames where there is motion  
% Here the study ask to remove the first 3 frames.
exclude=[1 2 3];
%______________________________________________________________________
%
% Q? - If we want to exclude frames during which the subject moved a lot
% we need to find out first. xdisp with TIC function allows us to see a
% movie of frames. How to interpret the plot produced by xdisp ?
%______________________________________________________________________
% Logical matrix indicating output statistics by 1. Rows correspond
% to rows of contrast, columns correspond to desired statistics.
which_stats=[1 1 1 1 0 0 0 0 0];

input_file='ida-ab171292-sonata-21247-20040314-100032-4-mri_MC.mnc';

output_file_base=['ida-ab171292-sonata-21247-20040314-100032-4-mri_C1   ';
                  'ida-ab171292-sonata-21247-20040314-100032-4-mri_C2MC3']

% fwhm in mm of a 3D Gaussian smoothing kernel:  
fwhm_rho = 15;

[df1 p]=fmrilm(input_file, output_file_base, X_cache, contrast, exclude, which_s
tats);
-----------------------------------------------
 
And I got the following error:
??? Index exceeds matrix dimensions.
Error in ==> /usr/local/matlab61/toolbox/fmri/fmrilm.m
On line 381  ==>       X=[squeeze(X_cache.X(keep,:,1,slice)) Trend(:,:,slice)];
Error in ==> /data/scratch1/yves/batch_ana.m
On line 249  ==> [df1 p]=fmrilm(input_file, output_file_base, X_cache, contrast, exclude, which_stats);
__________________________________________

Many thanks
Yves