0001 function weights = prt_cfg_weights
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 infile = cfg_files;
0013 infile.tag = 'infile';
0014 infile.name = 'Load PRT.mat';
0015 infile.filter = 'mat';
0016 infile.num = [1 1];
0017 infile.help = {['Select PRT.mat (file containing data/design/models ',...
0018 'structure).']};
0019
0020
0021
0022
0023 model_name = cfg_entry;
0024 model_name.tag = 'model_name';
0025 model_name.name = 'Model name';
0026 model_name.help = {'Name of a model. Must correspond with one ' ...
0027 'specified in ''Run model'' and ''Specify model'''...
0028 'batch modules.' };
0029 model_name.strtype = 's';
0030 model_name.num = [1 Inf];
0031
0032
0033
0034
0035 img_name = cfg_entry;
0036 img_name.tag = 'img_name';
0037 img_name.name = 'Image name (optional)';
0038 img_name.help = {['Name of the file with weights (optional). If left empty ',...
0039 ' an automatic name will be generated.']};
0040 img_name.strtype = 's';
0041 img_name.num = [0 Inf];
0042 img_name.val = {''};
0043
0044
0045
0046
0047 flag_cwi = cfg_menu;
0048 flag_cwi.tag = 'flag_cwi';
0049 flag_cwi.name = 'Build weight images for permutations';
0050 flag_cwi.help = {['Set to Yes to compute the weight images obtained ' ...
0051 'from each permutation. This is to further assess the significance ' ...
0052 'of the ranking distance between two models.']};
0053 flag_cwi.labels = {
0054 'Yes'
0055 'No'
0056 }';
0057 flag_cwi.values = {1 0};
0058 flag_cwi.val = {0};
0059
0060
0061
0062
0063 atl_name = cfg_files;
0064 atl_name.tag = 'atl_name';
0065 atl_name.name = 'Load Atlas';
0066 atl_name.ufilter = '.*';
0067 atl_name.filter = 'image';
0068 atl_name.num = [0 1];
0069 atl_name.val = {{''}};
0070 atl_name.def = @(val)prt_get_defaults('fs.atlasroi', val{:});
0071 atl_name.help = {'Select atlas file to build weights per ROI.'};
0072
0073
0074
0075
0076 no_atl = cfg_const;
0077 no_atl.tag = 'no_atl';
0078 no_atl.name = 'No weight per ROI';
0079 no_atl.val = {0};
0080 no_atl.help = {'Not computing weight per ROI.'};
0081
0082
0083
0084
0085 build_wpr = cfg_choice;
0086 build_wpr.tag = 'build_wpr';
0087 build_wpr.name = 'Build weight images per ROI';
0088 build_wpr.help = {['Set to Yes to compute the weight images per ROI ' ...
0089 'You need then to select the atlas image.']};
0090
0091
0092
0093
0094 build_wpr.values = {no_atl atl_name};
0095 build_wpr.val = {no_atl};
0096
0097
0098
0099
0100 flag_wroi = cfg_menu;
0101 flag_wroi.tag = 'flag_cwi';
0102 flag_wroi.name = 'Build weight images per ROI';
0103 flag_wroi.help = {['Set to Yes to compute the weight images obtained ' ...
0104 'from each ROI.']};
0105 flag_wroi.labels = {
0106 'Yes'
0107 'No'
0108 }';
0109 flag_wroi.values = {1 0};
0110 flag_wroi.val = {0};
0111
0112
0113
0114
0115 weights = cfg_exbranch;
0116 weights.tag = 'weights';
0117 weights.name = 'Compute weights';
0118 weights.val = {infile model_name img_name build_wpr flag_cwi};
0119 weights.help = {[
0120 'Compute weights. This module computes the linear weights of a classifier ',...
0121 'and saves them as a 4D image. 3 dimensions correspond to the image dimensions specified in ',...
0122 'the second-level mask, while the extra dimension corresponds to the number of folds. ',...
0123 'There is one 3D weights image per fold.']};
0124 weights.prog = @prt_run_weights;
0125 weights.vout = @vout_data;
0126
0127
0128
0129
0130 function cdep = vout_data(job)
0131
0132
0133 cdep(1) = cfg_dep;
0134 cdep(1).sname = 'PRT.mat file';
0135 cdep(1).src_output = substruct('.','files');
0136 cdep(1).tgt_spec = cfg_findspec({{'filter','mat','strtype','e'}});
0137 cdep(2) = cfg_dep;
0138 cdep(2).sname = 'Weight image file';
0139 cdep(2).src_output = substruct('.','files');
0140 cdep(2).tgt_spec = cfg_findspec({{'filter','img','strtype','e'}});
0141