Home > vbmeg > functions > estimation > bayes > vb_parm_absolute_path.m

vb_parm_absolute_path

PURPOSE ^

vbmeg-0.30b

SYNOPSIS ^

function bayes_parm_absolute_path = vb_parm_absolute_path(proj_root, bayes_parm)

DESCRIPTION ^

 vbmeg-0.30b   
 vbmeg-0.31   by R.H
 2010-04-02 rhayashi bug fix(failed to make cell when char is given.)

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function bayes_parm_absolute_path = vb_parm_absolute_path(proj_root, bayes_parm)
0002 % vbmeg-0.30b
0003 % vbmeg-0.31   by R.H
0004 % 2010-04-02 rhayashi bug fix(failed to make cell when char is given.)
0005 %
0006 % Copyright (C) 2011, ATR All Rights Reserved.
0007 % License : New BSD License(see VBMEG_LICENSE.txt)
0008 
0009 %%%
0010 %fprintf('New absolute_path program\n')
0011 
0012 proj_root = vb_rm_trailing_slash(proj_root);
0013 
0014 bayes_parm_absolute_path = bayes_parm;
0015 
0016 %----------------> absolute path
0017 bayes_parm_absolute_path.brainfile = ...
0018     fullfile(proj_root, bayes_parm.brainfile);
0019 
0020 % --- (X_X) actually these are BAD CODINGS to combine proj_root and file here
0021 if isempty(bayes_parm.actfile)
0022   bayes_parm_absolute_path.actfile = '';
0023 else
0024   bayes_parm_absolute_path.actfile = ...
0025     fullfile(proj_root, bayes_parm.actfile);
0026 end
0027 
0028 if isempty(bayes_parm.areafile)
0029   bayes_parm_absolute_path.areafile = '';
0030 else
0031   bayes_parm_absolute_path.areafile = ...
0032     fullfile(proj_root, bayes_parm.areafile);
0033 end
0034 % --- (X_X) actually these are BAD CODINGS to combine proj_root and file here
0035 if ischar(bayes_parm.megfile)
0036     bayes_parm.megfile = {bayes_parm.megfile};
0037 end
0038 bayes_parm_absolute_path.megfile = cell(length(bayes_parm.megfile), 1);
0039 for k=1:length(bayes_parm.megfile)
0040     bayes_parm_absolute_path.megfile{k,1} = fullfile(proj_root, bayes_parm.megfile{k});
0041 end
0042 
0043 if ischar(bayes_parm.megfile_baseline)
0044     bayes_parm.megfile_baseline = {bayes_parm.megfile_baseline};
0045 end
0046 bayes_parm_absolute_path.megfile_baseline = cell(length(bayes_parm.megfile_baseline), 1);
0047 for k=1:length(bayes_parm.megfile_baseline)
0048     bayes_parm_absolute_path.megfile_baseline{k,1} = fullfile(proj_root, bayes_parm.megfile_baseline{k});
0049 end
0050 if ischar(bayes_parm.basisfile_global)
0051     bayes_parm.basisfile_global = {bayes_parm.basisfile_global};
0052 end
0053 bayes_parm_absolute_path.basisfile_global = cell(length(bayes_parm.basisfile_global),1);
0054 for k=1:length(bayes_parm.basisfile_global)
0055     bayes_parm_absolute_path.basisfile_global{k,1} = fullfile(proj_root, bayes_parm.basisfile_global{k});
0056 end
0057 
0058 if ischar(bayes_parm.basisfile)
0059     bayes_parm.basisfile = {bayes_parm.basisfile};
0060 end
0061 bayes_parm_absolute_path.basisfile = cell(length(bayes_parm.basisfile), 1);
0062 for k=1:length(bayes_parm.basisfile)
0063     bayes_parm_absolute_path.basisfile{k,1} = fullfile(proj_root, bayes_parm.basisfile{k});
0064 end
0065 
0066 bayes_parm_absolute_path.bayesfile = ...
0067     fullfile(proj_root, bayes_parm.bayesfile);
0068 
0069 if isfield(bayes_parm,'extra') && isfield(bayes_parm.extra,'basisfile')
0070     if isempty(bayes_parm.extra.basisfile)
0071         bayes_parm_absolute_path.extra.basisfile = '';
0072     else
0073         if ischar(bayes_parm.extra.basisfile)
0074             bayes_parm.extra.basisfile = {bayes_parm.extra.basisfile};
0075         end
0076         bayes_parm_absolute_path.extra.basisfile = cell(length(bayes_parm.extra.basisfile),1);
0077         for k=1:length(bayes_parm.extra.basisfile)
0078             bayes_parm_absolute_path.extra.basisfile{k,1} = fullfile(proj_root, bayes_parm.extra.basisfile{k});
0079         end
0080     end
0081 end

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005