Home > batch > prt_cfg_fs.m

prt_cfg_fs

PURPOSE ^

Data & design configuration file

SYNOPSIS ^

function fs = prt_cfg_fs

DESCRIPTION ^

 Data & design configuration file
 This configures the fs construction for each modality.
_______________________________________________________________________
 Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function fs = prt_cfg_fs
0002 % Data & design configuration file
0003 % This configures the fs construction for each modality.
0004 %_______________________________________________________________________
0005 % Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory
0006 
0007 % Written by Andre Marquand
0008 % $Id$
0009 
0010 % ---------------------------------------------------------------------
0011 % filename Filename(s) of data
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 % k_file Name
0022 % ---------------------------------------------------------------------
0023 k_file         = cfg_entry;
0024 k_file.tag     = 'k_file';
0025 k_file.name    = 'Feature/kernel 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 % % use_mkl Use MKL?
0033 % % ---------------------------------------------------------------------
0034 % use_mkl         = cfg_menu;
0035 % use_mkl.tag     = 'use_mkl';
0036 % use_mkl.name    = 'Generate Multiple Kernels?';
0037 % use_mkl.labels  = {
0038 %                'Yes'
0039 %                'No'
0040 % }';
0041 % use_mkl.values  = {1 0};
0042 % use_mkl.val     = {0};
0043 % use_mkl.help    = {'Do you wish to generate Multiple Kernels?'};
0044 
0045 % ---------------------------------------------------------------------
0046 % multkernflag Use multiple modality kernels
0047 % ---------------------------------------------------------------------
0048 flag_mm         = cfg_menu;
0049 flag_mm.tag     = 'flag_mm';
0050 flag_mm.name    = 'Use one kernel per modality';
0051 flag_mm.help    = {'Select "Yes" to use one kernel per modality.'};
0052 flag_mm.labels  = {
0053     'Yes'
0054     'No'
0055     }';
0056 flag_mm.values  = {1 0};
0057 flag_mm.val     = {0};
0058 
0059 % ---------------------------------------------------------------------
0060 % atlasroi Filename(s) of atlas for ROI MKL
0061 % ---------------------------------------------------------------------
0062 atlasroi         = cfg_files;
0063 atlasroi.tag     = 'atlasroi';
0064 atlasroi.name    = 'Use atlas to build ROI specific kernels';
0065 atlasroi.ufilter = '.*';
0066 atlasroi.filter  = 'image';
0067 atlasroi.num     = [0 1];
0068 atlasroi.val     = {{''}};
0069 % atlasroi.def     = @(val)prt_get_defaults('fs.atlasroi', val{:});
0070 atlasroi.help    = {['Select an atlas file to build one kernel per ROI. ', ...
0071     'The AAL atlas (named ''aal_79x91x69.img'') is available in the ''atlas'' subdirectory of PRoNTo']};
0072            
0073 % ---------------------------------------------------------------------
0074 % cond_name Name
0075 % ---------------------------------------------------------------------
0076 cond_name         = cfg_entry;
0077 cond_name.tag     = 'cond_name';
0078 cond_name.name    = 'Condition';
0079 cond_name.help    = {'Name of condition to include.'};
0080 cond_name.strtype = 's';
0081 cond_name.num     = [1 Inf];
0082 
0083 % ---------------------------------------------------------------------
0084 % all_cond All conditions
0085 % ---------------------------------------------------------------------
0086 all_cond         = cfg_const;
0087 all_cond.tag     = 'all_cond';
0088 all_cond.name    = 'All Conditions';
0089 all_cond.val     = {1};
0090 all_cond.help    = {'Include all conditions in this kernel matrix'};
0091 
0092 % ---------------------------------------------------------------------
0093 % all_scans All scans
0094 % ---------------------------------------------------------------------
0095 all_scans         = cfg_const;
0096 all_scans.tag     = 'all_scans';
0097 all_scans.name    = 'All scans';
0098 all_scans.val     = {1};
0099 all_scans.help    = {['No design specified. This option can be used '...
0100                      'for modalities (e.g. structural scans) that do not '...
0101                      'have an experimental design or for an fMRI design',...
0102                      'where you want to include all scans in the timeseries']};
0103                  
0104 % ---------------------------------------------------------------------
0105 % conditions Conditions
0106 % ---------------------------------------------------------------------
0107 conditions        = cfg_choice;
0108 conditions.tag    = 'conditions';
0109 conditions.name   = 'Scans / Conditions';
0110 conditions.values = {all_scans, all_cond};
0111 conditions.val    = {all_scans};
0112 conditions.help   = {...
0113 ['Which task conditions do you want to include in the kernel matrix? '...
0114  'Select conditions: select specific conditions from the timeseries. ', ...
0115  'All conditions: include all conditions extracted from the timeseries. ', ...
0116  'All scans: include all scans for each subject. This may be used for ', ...
0117  'modalities with only one scan per subject (e.g. PET), ', ... 
0118  'if you want to include all scans from an fMRI timeseries (assumes you ',...
0119  'have not already detrended the timeseries and extracted task components)']};
0120 
0121 % % ---------------------------------------------------------------------
0122 % % detrend Detrend
0123 % % ---------------------------------------------------------------------
0124 % detrend         = cfg_menu;
0125 % detrend.tag     = 'detrend';
0126 % detrend.name    = 'Detrend';
0127 % detrend.help    = {'Type of temporal detrending to apply'};
0128 % detrend.labels  = {
0129 %                'None'
0130 %                'Linear'
0131 % }';
0132 % detrend.values  = {0 1};
0133 % detrend.val     = {0};
0134 
0135 % ---------------------------------------------------------------------
0136 % param_dt Name
0137 % ---------------------------------------------------------------------
0138 param_dt         = cfg_entry;
0139 param_dt.tag     = 'param_dt';
0140 param_dt.name    = 'Cutoff of high-pass filter (second)';
0141 param_dt.help    = {[...
0142     'The default high-pass filter cutoff is 128 seconds (same as SPM)']};
0143 param_dt.strtype = 'e';
0144 param_dt.val     = {128};
0145 param_dt.num     = [1 1];
0146 
0147 % ---------------------------------------------------------------------
0148 % dct_dt DCT
0149 % ---------------------------------------------------------------------
0150 dct_dt      = cfg_branch;
0151 dct_dt.tag  = 'dct_dt';
0152 dct_dt.name = 'Discrete cosine transform';
0153 dct_dt.val  = {param_dt};
0154 dct_dt.help = {'Use a discrete cosine basis set to detrend the data.'};
0155 
0156 % ---------------------------------------------------------------------
0157 % no_dt No detrend
0158 % ---------------------------------------------------------------------
0159 no_dt         = cfg_const;
0160 no_dt.tag     = 'no_dt';
0161 no_dt.name    = 'None';
0162 no_dt.val     = {1};
0163 no_dt.help    = {['Do not detrend the data ']};
0164 
0165 % ---------------------------------------------------------------------
0166 % paramPoly_dt Name
0167 % ---------------------------------------------------------------------
0168 paramPoly_dt         = cfg_entry;
0169 paramPoly_dt.tag     = 'paramPoly_dt';
0170 paramPoly_dt.name    = 'Order';
0171 paramPoly_dt.help    = {[...
0172     'Enter the order for polynomial detrend (1 is linear detrend)']};
0173 paramPoly_dt.strtype = 'e';
0174 paramPoly_dt.val     = {1};
0175 paramPoly_dt.num     = [1 1];
0176 
0177 % ---------------------------------------------------------------------
0178 % linear_dt Polynomial detrend
0179 % ---------------------------------------------------------------------
0180 linear_dt         = cfg_branch;
0181 linear_dt.tag     = 'linear_dt';
0182 linear_dt.name    = 'Polynomial detrend ';
0183 linear_dt.val     = {paramPoly_dt};
0184 linear_dt.help    = {'Perform a voxel-wise polynomial detrend on the data (1 is linear detrend) '};
0185 
0186 % ---------------------------------------------------------------------
0187 % detrend Conditions
0188 % ---------------------------------------------------------------------
0189 detrend        = cfg_choice;
0190 detrend.tag    = 'detrend';
0191 detrend.name   = 'Detrend';
0192 detrend.values = {no_dt, linear_dt, dct_dt};
0193 detrend.val    = {no_dt};
0194 detrend.help   = {...
0195 ['Type of temporal detrending to apply']};
0196 
0197 % ---------------------------------------------------------------------
0198 % fmask File name
0199 % ---------------------------------------------------------------------
0200 fmask        = cfg_files;
0201 fmask.tag    = 'fmask';
0202 fmask.name   = 'Specify mask file';
0203 fmask.filter = 'image';
0204 fmask.ufilter = '.*';
0205 fmask.num    = [1 1];
0206 fmask.help   = {'Select a mask for the selected modality.'};
0207 
0208 % ---------------------------------------------------------------------
0209 % mod_name Name
0210 % ---------------------------------------------------------------------
0211 mod_name         = cfg_entry;
0212 mod_name.tag     = 'mod_name';
0213 mod_name.name    = 'Modality name';
0214 mod_name.help    = {'Name of modality. Example: ''BOLD''. Must match design specification'};
0215 mod_name.strtype = 's';
0216 mod_name.num     = [1 Inf];
0217 
0218 % ---------------------------------------------------------------------
0219 % no_gms No normalisation
0220 % ---------------------------------------------------------------------
0221 no_gms         = cfg_const;
0222 no_gms.tag     = 'no_gms';
0223 no_gms.name    = 'No scaling';
0224 no_gms.val     = {1};
0225 no_gms.help    = {'Do not scale the input scans'};
0226 
0227 % ---------------------------------------------------------------------
0228 % mat_norm File name
0229 % ---------------------------------------------------------------------
0230 mat_gms        = cfg_files;
0231 mat_gms.tag    = 'mat_gms';
0232 mat_gms.name   = 'Specify from *.mat';
0233 mat_gms.filter = 'mat';
0234 mat_gms.ufilter = '^*.mat';
0235 mat_gms.num    = [1 1];
0236 mat_gms.help   = {[...
0237     'Specify a mat file containing the scaling parameters for each modality.']};
0238 
0239 % ---------------------------------------------------------------------
0240 % normalise
0241 % ---------------------------------------------------------------------
0242 normalise        = cfg_choice;
0243 normalise.tag    = 'normalise';
0244 normalise.name   = 'Scale input scans';
0245 normalise.values = {no_gms, mat_gms};
0246 normalise.val    = {no_gms};
0247 normalise.help   = {...
0248     ['Do you want to scale the input scans to have a fixed mean '...
0249     '(i.e. grand mean scaling)?']};
0250 
0251 % ---------------------------------------------------------------------
0252 % all_voxels All voxels
0253 % ---------------------------------------------------------------------
0254 all_voxels         = cfg_const;
0255 all_voxels.tag     = 'all_voxels';
0256 all_voxels.name    = 'All voxels';
0257 all_voxels.val     = {1};
0258 all_voxels.help    = {'Use all voxels in the design mask for this modality'};
0259 
0260 % ---------------------------------------------------------------------
0261 % voxels
0262 % ---------------------------------------------------------------------
0263 voxels        = cfg_choice;
0264 voxels.tag    = 'voxels';
0265 voxels.name   = 'Voxels to include';
0266 voxels.values = {all_voxels, fmask};
0267 voxels.val    = {all_voxels};
0268 voxels.help   = {...
0269     ['Specify which voxels from the current modality you would like to include']};
0270 
0271 % ---------------------------------------------------------------------
0272 % modality Modality
0273 % ---------------------------------------------------------------------
0274 modality      = cfg_branch;
0275 modality.tag  = 'modality';
0276 modality.name = 'Modality';
0277 modality.val  = {mod_name, conditions, voxels, detrend, normalise, atlasroi};
0278 modality.help = {'Specify modality, such as name and data.'};
0279 
0280 % ---------------------------------------------------------------------
0281 % modalities Groups
0282 % ---------------------------------------------------------------------
0283 modalities         = cfg_repeat;
0284 modalities.tag     = 'modalities';
0285 modalities.name    = 'Modalities';
0286 modalities.help    = {'Add modalities'};
0287 modalities.num     = [1 Inf];
0288 modalities.values  = {modality};
0289 
0290 % ---------------------------------------------------------------------
0291 % Configure Feature set
0292 % ---------------------------------------------------------------------
0293 fs        = cfg_exbranch;
0294 fs.tag    = 'fs';
0295 fs.name   = 'Feature set/Kernel';
0296 % fs.val    = {infile, k_file, modalities, use_mkl, flag_mm};
0297 fs.val    = {infile, k_file, modalities, flag_mm};
0298 fs.help   = {'Compute feature set according to the design specified'};
0299 fs.prog   = @prt_run_fs;
0300 fs.vout   = @vout_data;
0301 
0302 %------------------------------------------------------------------------
0303 %% Output function
0304 %------------------------------------------------------------------------
0305 function cdep = vout_data(job)
0306 % Specifies the output from this modules, i.e. the filename of the mat file
0307 
0308 cdep(1)            = cfg_dep;
0309 cdep(1).sname      = 'PRT.mat file';
0310 cdep(1).src_output = substruct('.','fname');
0311 cdep(1).tgt_spec   = cfg_findspec({{'filter','mat','strtype','e'}});
0312 cdep(2)            = cfg_dep;
0313 cdep(2).sname      = 'Feature/kernel name';
0314 cdep(2).src_output = substruct('.','fs_name');
0315 cdep(2).tgt_spec   = cfg_findspec({{'strtype','s'}});
0316 
0317 %------------------------------------------------------------------------
0318

Generated on Tue 10-Feb-2015 18:16:33 by m2html © 2005