


PRONTO job execution function
INPUT
job - harvested job data structure (see matlabbatch help)
OUTPUT
out - filename of saved data structure (1 file per group, per
subject, per modality, per condition
__________________________________________________________________________
Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory

0001 function out = prt_run_weights(varargin) 0002 % 0003 % PRONTO job execution function 0004 % 0005 % INPUT 0006 % job - harvested job data structure (see matlabbatch help) 0007 % 0008 % OUTPUT 0009 % out - filename of saved data structure (1 file per group, per 0010 % subject, per modality, per condition 0011 %__________________________________________________________________________ 0012 % Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory 0013 0014 % Written by M.J.Rosa 0015 % $Id$ 0016 0017 job = varargin{1}; 0018 0019 % Load PRT.mat 0020 % ------------------------------------------------------------------------- 0021 fname = char(job.infile); 0022 PRT = prt_load(fname); 0023 if ~isempty(PRT) 0024 handles.dat = PRT; 0025 else 0026 beep 0027 disp('Could not load file') 0028 return 0029 end 0030 pathdir = regexprep(fname,'PRT.mat', ''); 0031 0032 % ------------------------------------------------------------------------- 0033 % Input file 0034 % ------------------------------------------------------------------------- 0035 in.img_name = job.img_name; 0036 in.model_name = job.model_name; 0037 in.pathdir = pathdir; 0038 if isfield(job,'flag_cwi') 0039 flag = job.flag_cwi; 0040 else 0041 flag = 0; 0042 end 0043 0044 % ------------------------------------------------------------------------- 0045 % Weights per ROI 0046 % ------------------------------------------------------------------------- 0047 if isfield(job, 'build_wpr') 0048 if isfield(job.build_wpr,'atl_name') && ~isempty(job.build_wpr.atl_name{1}) 0049 in.atl_name = job.build_wpr.atl_name{1}; 0050 flag2 = 1; 0051 else 0052 in.atl_name = []; 0053 flag2 = 0; 0054 end 0055 else % This should make things compatible older jobs... 0056 in.atl_name = []; 0057 flag2 = 0; 0058 end 0059 0060 img_name = prt_compute_weights(PRT, in, flag, flag2); 0061 0062 % ------------------------------------------------------------------------- 0063 % Function output 0064 % ------------------------------------------------------------------------- 0065 disp('Weights computation complete.') 0066 out.files{1} = fname; 0067 out.files{2} = img_name; 0068 disp('Done') 0069 0070 return