Creating the EXPT structure - sjgershm/ccnl-fmri GitHub Wiki

The first step in the pipeline is to assemble some basic information about your experiment into a Matlab structure. This should look something like:

%% Experiment info
EXPT.TR = 2;                        % repetition time (seconds)
EXPT.create_multi = @create_multi;  % handle for function that creates multi structures
EXPT.modeldir = 'models';           % where to put model results

%% Subject info
EXPT.subject(1).datadir = 'subject1';                     % where the data are stored
EXPT.subject(1).functional = {'run001.nii' 'run002.nii'}; % functional (EPI) nifti files
EXPT.subject(1).structural = 'struct.nii';                % structural (T1) nifti files
EXPT.subject(2).datadir = 'subject2';                     
EXPT.subject(2).functional = {'run001.nii' 'run002.nii'};
EXPT.subject(2).structural = 'struct.nii';          

The create_multi function should have the following syntax:

multi = create_multi(model,subj,run)

where:

  • model is an integer specifying which general linear model (GLM) to estimate.
  • subj is an integer specifying which subject is being analyzed
  • run is an integer specifying the run

The output should have the following form (specific to the model/subject/run under consideration):

multi.names{1} = 'stim';
multi.onsets{1} = [10 20];
multi.durations{1} = 0;
multi.pmod(1).name{1} = 'val';
multi.pmod(1).param{1} = [-1 1];
multi.pmod(1).poly{1} = 1;

Onsets should be in seconds relative to the onset of the run. The pmod (parametric modulator) field is optional. See the SPM manual for more information about parametric modulators.