0001 function fs = prt_cfg_fs
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 infile = cfg_files;
0014 infile.tag = 'infile';
0015 infile.name = 'Load PRT.mat';
0016 infile.ufilter = 'PRT.mat';
0017 infile.num = [1 1];
0018 infile.help = {'Select data/design structure file (PRT.mat).'};
0019
0020
0021
0022
0023 k_file = cfg_entry;
0024 k_file.tag = 'k_file';
0025 k_file.name = 'Name';
0026 k_file.help = {['Target name for kernel matrix. This should contain' ...
0027 'only alphanumerical characters or underscores (_).']};
0028 k_file.strtype = 's';
0029 k_file.num = [1 Inf];
0030
0031
0032
0033
0034 cond_name = cfg_entry;
0035 cond_name.tag = 'cond_name';
0036 cond_name.name = 'Condition';
0037 cond_name.help = {'Name of condition to include.'};
0038 cond_name.strtype = 's';
0039 cond_name.num = [1 Inf];
0040
0041
0042
0043
0044 all_cond = cfg_const;
0045 all_cond.tag = 'all_cond';
0046 all_cond.name = 'All Conditions';
0047 all_cond.val = {1};
0048 all_cond.help = {'Include all conditions in this kernel matrix'};
0049
0050
0051
0052
0053 all_scans = cfg_const;
0054 all_scans.tag = 'all_scans';
0055 all_scans.name = 'All scans';
0056 all_scans.val = {1};
0057 all_scans.help = {['No design specified. This option can be used '...
0058 'for modalities (e.g. structural scans) that do not '...
0059 'have an experimental design or for an fMRI design',...
0060 'where you want to include all scans in the timeseries']};
0061
0062
0063
0064
0065 conditions = cfg_choice;
0066 conditions.tag = 'conditions';
0067 conditions.name = 'Scans / Conditions';
0068 conditions.values = {all_scans, all_cond};
0069 conditions.val = {all_scans};
0070 conditions.help = {...
0071 ['Which task conditions do you want to include in the kernel matrix? '...
0072 'Select conditions: select specific conditions from the timeseries. ', ...
0073 'All conditions: include all conditions extracted from the timeseries. ', ...
0074 'All scans: include all scans for each subject. This may be used for ', ...
0075 'modalities with only one scan per subject (e.g. PET), ', ...
0076 'if you want to include all scans from an fMRI timeseries (assumes you ',...
0077 'have not already detrended the timeseries and extracted task components)']};
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096 param_dt = cfg_entry;
0097 param_dt.tag = 'param_dt';
0098 param_dt.name = 'Cutoff of high-pass filter (second)';
0099 param_dt.help = {[...
0100 'The default high-pass filter cutoff is 128 seconds (same as SPM)']};
0101 param_dt.strtype = 'e';
0102 param_dt.val = {128};
0103 param_dt.num = [1 1];
0104
0105
0106
0107
0108 dct_dt = cfg_branch;
0109 dct_dt.tag = 'dct_dt';
0110 dct_dt.name = 'Discrete cosine transform';
0111 dct_dt.val = {param_dt};
0112 dct_dt.help = {'Use a discrete cosine basis set to detrend the data.'};
0113
0114
0115
0116
0117 no_dt = cfg_const;
0118 no_dt.tag = 'no_dt';
0119 no_dt.name = 'None';
0120 no_dt.val = {1};
0121 no_dt.help = {['Do not detrend the data ']};
0122
0123
0124
0125
0126 paramPoly_dt = cfg_entry;
0127 paramPoly_dt.tag = 'paramPoly_dt';
0128 paramPoly_dt.name = 'Order';
0129 paramPoly_dt.help = {[...
0130 'Enter the order for polynomial detrend (1 is linear detrend)']};
0131 paramPoly_dt.strtype = 'e';
0132 paramPoly_dt.val = {1};
0133 paramPoly_dt.num = [1 1];
0134
0135
0136
0137
0138 linear_dt = cfg_branch;
0139 linear_dt.tag = 'linear_dt';
0140 linear_dt.name = 'Polynomial detrend ';
0141 linear_dt.val = {paramPoly_dt};
0142 linear_dt.help = {'Perform a voxel-wise polynomial detrend on the data (1 is linear detrend) '};
0143
0144
0145
0146
0147 detrend = cfg_choice;
0148 detrend.tag = 'detrend';
0149 detrend.name = 'Detrend';
0150 detrend.values = {no_dt, linear_dt, dct_dt};
0151 detrend.val = {no_dt};
0152 detrend.help = {...
0153 ['Type of temporal detrending to apply']};
0154
0155
0156
0157
0158 fmask = cfg_files;
0159 fmask.tag = 'fmask';
0160 fmask.name = 'Specify mask file';
0161 fmask.filter = 'image';
0162 fmask.ufilter = '.*';
0163 fmask.num = [1 1];
0164 fmask.help = {'Select a mask for the selected modality.'};
0165
0166
0167
0168
0169 mod_name = cfg_entry;
0170 mod_name.tag = 'mod_name';
0171 mod_name.name = 'Name';
0172 mod_name.help = {'Name of modality. Example: ''BOLD''. Must match design specification'};
0173 mod_name.strtype = 's';
0174 mod_name.num = [1 Inf];
0175
0176
0177
0178
0179 no_gms = cfg_const;
0180 no_gms.tag = 'no_gms';
0181 no_gms.name = 'No scaling';
0182 no_gms.val = {1};
0183 no_gms.help = {'Do not scale the input scans'};
0184
0185
0186
0187
0188 mat_gms = cfg_files;
0189 mat_gms.tag = 'mat_gms';
0190 mat_gms.name = 'Specify from *.mat';
0191 mat_gms.filter = 'mat';
0192 mat_gms.ufilter = '^*.mat';
0193 mat_gms.num = [1 1];
0194 mat_gms.help = {[...
0195 'Specify a mat file containing the scaling parameters for each modality.']};
0196
0197
0198
0199
0200 normalise = cfg_choice;
0201 normalise.tag = 'normalise';
0202 normalise.name = 'Scale input scans';
0203 normalise.values = {no_gms, mat_gms};
0204 normalise.val = {no_gms};
0205 normalise.help = {...
0206 ['Do you want to scale the input scans to have a fixed mean '...
0207 '(i.e. grand mean scaling)?']};
0208
0209
0210
0211
0212 all_voxels = cfg_const;
0213 all_voxels.tag = 'all_voxels';
0214 all_voxels.name = 'All voxels';
0215 all_voxels.val = {1};
0216 all_voxels.help = {'Use all voxels in the design mask for this modality'};
0217
0218
0219
0220
0221 voxels = cfg_choice;
0222 voxels.tag = 'voxels';
0223 voxels.name = 'Voxels to include';
0224 voxels.values = {all_voxels, fmask};
0225 voxels.val = {all_voxels};
0226 voxels.help = {...
0227 ['Specify which voxels from the current modality you would like to include']};
0228
0229
0230
0231
0232 modality = cfg_branch;
0233 modality.tag = 'modality';
0234 modality.name = 'Modality';
0235 modality.val = {mod_name conditions, voxels, detrend, normalise};
0236 modality.help = {'Specify modality, such as name and data.'};
0237
0238
0239
0240
0241 modalities = cfg_repeat;
0242 modalities.tag = 'modalities';
0243 modalities.name = 'Modalities';
0244 modalities.help = {'Add modalities'};
0245 modalities.num = [1 Inf];
0246 modalities.values = {modality};
0247
0248
0249
0250
0251 fs = cfg_exbranch;
0252 fs.tag = 'fs';
0253 fs.name = 'Feature set / Kernel';
0254 fs.val = {infile, k_file, modalities};
0255 fs.help = {'Compute feature set according to the design specified'};
0256 fs.prog = @prt_run_fs;
0257 fs.vout = @vout_data;
0258
0259
0260
0261
0262 function cdep = vout_data(job)
0263
0264
0265 cdep(1) = cfg_dep;
0266 cdep(1).sname = 'PRT.mat file';
0267 cdep(1).src_output = substruct('.','fname');
0268 cdep(1).tgt_spec = cfg_findspec({{'filter','mat','strtype','e'}});
0269
0270