0001
0002
0003
0004
0005
0006
0007 global SPM_BCH_VARS
0008
0009 sess_dir = SPM_BCH_VARS.sess_dir;
0010 sesses = SPM_BCH_VARS.sesses;
0011 nsessions = length(sesses);
0012
0013 TR = 2.02726;
0014 condnames = {'vis_stim'};
0015 nconds = length(condnames);
0016
0017 clear scannames scannos;
0018 for ss = 1:nsessions
0019 fildir = fullfile(sess_dir, sesses{ss});
0020
0021 files = spm_get('Files', fildir, 's*.img');
0022 scannos(ss) = size(files,1);
0023 scannames(ss) = {files};
0024
0025
0026 condir = fullfile(fildir, 'onsets');
0027 condfile = spm_get('Files', condir, 'flash*.txt');
0028 condons = spm_load(condfile);
0029 stimons = condons(:,2);
0030 stimons(stimons < 0) = 0;
0031
0032 conditions(ss) = struct( ...
0033 'names', {condnames},...
0034 'onsets',{{stimons}},...
0035 'types', {repmat({'events'},1,nconds)}, ...
0036 'bf_ev', [ones(1,nconds)], ...
0037 'bf_ep', [0], ...
0038 'volterra', 0, ...
0039 'variable_dur', 0 ...
0040 );
0041
0042 end
0043
0044
0045
0046
0047 o = ones(1, nsessions);
0048 model(1) = struct( ...
0049 'types', 4, ...
0050 'global_effects', {'None'}, ...
0051 'burst_mode', 0, ...
0052 'HF_fil', 'specify', ...
0053 'HF_cut', o * 60, ...
0054 'LF_fil', 'hrf', ...
0055 'LF_cut', 4, ...
0056 'int_corr', 'none', ...
0057 'now_later', 0 , ...
0058 'stop_writing', 0, ...
0059 'trial_fcon', 0, ...
0060 'RT', TR, ...
0061 'replicated', 0, ...
0062 'nsess', nsessions, ...
0063 'nscans', scannos, ...
0064 'files', {scannames}, ...
0065 'conditions_nb', [ones(1,nsessions) * nconds], ...
0066 'conditions', [1:nsessions], ...
0067 'regressors_nb', o * 0, ...
0068 'regressors', [], ...
0069 'parametrics_type', {repmat({'none'},1,nsessions)}, ...
0070 'parametrics', [], ...
0071 'stochastics_flag', [0], ...
0072 'stochastics', [] ...
0073 );
0074
0075
0076
0077 bf_ev(1) = struct( ...
0078 'ev_type', 2, ...
0079 'win_len',[], ...
0080 'order', [] ...
0081 );
0082